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