Question

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?

Was it helpful?

Solution

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);

OTHER TIPS

You should set parent of the menu bar. It should be main window. If parent disabled, actions will be disabled too.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top