Reputation: 5556
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
Reputation: 4319
Set visible/unvisible for the action, not for QMenu:
ui->menuTests->menuAction()->setVisible(false);
Upvotes: 1