aarelovich
aarelovich

Reputation: 5556

Why am I unable to make a QMenu invisible?

I added a QMenu with the designer to my QMainWindow for actions that are only for debugging and tests. I want to simply make it invisible for a realese compilation.

However when I call:

ui->menuTests->setVisible(false);

Nothing happens? How do I make that menu not visible without removing it from my application? (I can disable it, but that is horrible....)

Upvotes: 1

Views: 311

Answers (1)

AnatolyS
AnatolyS

Reputation: 4319

Set visible/unvisible for the action, not for QMenu:

ui->menuTests->menuAction()->setVisible(false);

Upvotes: 1

Related Questions