Reputation: 90853
I need to temporarily disable the main window, including the menu bar. The main window can be disabled simply using setEnabled(false)
however it seems that doesn't disable the menu bar, so the user can still click menu items (which in my case break the application).
Is there any way to completely disable all user interactions, including the menu bar?
Upvotes: 0
Views: 2613
Reputation: 3536
You should set parent of the menu bar. It should be main window. If parent disabled, actions will be disabled too.
Upvotes: 1
Reputation: 32685
Calling setEnabled(false)
in main window also disables menu bar. Any way you can also use setEnabled
method of QMenuBar
class :
ui->menuBar->setEnabled(false);
Upvotes: 2