I have a modal dialog box that I need to be displayed until I'm finished some processing. However the user can close/hide the dialog by pressing the "ESC" key. How can I override this default behavior in QDialog so I can stop it from doing this?
I have a modal dialog box that I need to be displayed until I'm finished some processing. However the user can close/hide the dialog by pressing the "ESC" key. How can I override this default behavior in QDialog so I can stop it from doing this?
If the user presses the Esc key in a dialog, QDialog::reject() will be called. You can reimplement that function to do nothing under certain circumstances:
Qt Code:
void MyDialog::reject() { if (itsOkToClose) { } }To copy to clipboard, switch view to plain text mode
J-P Nurmi
will49 (27th May 2008)
Great. That worked.
Bookmarks