Can't hide QMenu object QMenu :: setVisible ()?

I created QMenu MainMenuon top of mine MainWindowin my application. Since everyone is used to it, I have the following QMenuMain menus:

File - Edit - SuperHeavyExpertMenus - Settings - Help

I would like to hide the auxiliary tree SuperHeaverExpertMenusinitially, when the program starts, because it encodes many settings that can confuse novice users.

I want to show this subtree with SuperHeavyExpertMenuif the checkbox in the settings is true, for example.

I can hide the kids QActionsabove QMenu, vie QAction:setVisible(false). but can i do it for QMenu?

Is there any way to hide QMenu?

+4
source share
1 answer

If I understand your problem correctly, then how you can solve it is something like this:

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

I hope to be of service.

+9
source

Source: https://habr.com/ru/post/1605734/


All Articles