Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt to gray out and disable all actions in MainWindow

Tags:

windows-7

qt4

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?

like image 724
Stan Avatar asked Mar 22 '23 13:03

Stan


1 Answers

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.

like image 197
JKSH Avatar answered Apr 25 '23 09:04

JKSH