PDA

View Full Version : How to hide/remove a addMenu() menu



MrGarbage
4th August 2007, 00:05
Hi,

I've added a menu and menu items using menuBar()->addMenu() and the subsequent addAction() calls. I know that calling clear() will remove the menu subitems added by addAction(), but how do I remove or hide the actual menu
item that was added by the addMenu() call.

I don't see any reference to this functionality.

Thanks!

Mark

marcel
4th August 2007, 00:24
addMenu returns a QAction*.
Use QMenuBar::removeAction(QAction*) to remove it.

Regards

marcel
4th August 2007, 00:32
For hiding a menu when you own its action you can call QAction::menu()->setVisible(false) or hide().

To show it call setVisible(true) or show().

Regards