Qt to gray out and disable all actions in MainWindow

qt4, windows-7

Solution

Yes. Just call `QWidget::setEnabled(false)` to disable a window/widget, and `QWidget::setEnabled(true)` to enable it. http://qt-project.org/doc/qt-4.8/qwidget.html#enabled-prop

By the way, the Qt documentation is very comprehensive. Just search there, and you should easily find answers to many questions.

Problem

Say upon launching the Qt application, is there a way to display a grayed out main window, and disable all the widgets (buttons/checkboxes/etc) - not able to click. Once the user open a file or do some init procedure, the main window becomes non-grayed out and enable all widgets. Is this something possible in Qt?

Original source