PDA

View Full Version : A Dialog that cannot be exited



VireX
24th March 2007, 22:08
I want to make like an Autoupdate dialog, that cannot be exited, closed, or interrupted.
Is there a way for QDialog to remove the "X" button and possible not close until some sort of signal or another class says it can?

jacek
24th March 2007, 22:40
Try reimplementing QDialog::done(), if it's not enough, you can always reimplement QWidget::closeEvent().

wysota
24th March 2007, 22:47
I would just use a frameless modal widget for that - no window buttons tempting to be pressed :)

VireX
25th March 2007, 01:29
Closes the dialog and sets its result code to r. If this dialog is shown with exec(), done() causes the local event loop to finish, and exec() to return r.

This is what it says for QDialog::done... so I don't think that disables the X button etc.
I know in Win API they had WS_ window style options to hide certain menus, such as "x", minimize, or the title bar. Is there anything like that for QDialog?

I used designer to make the QDialog, so I dont know how I would convert it to a modal widget without a frame.

wysota
26th March 2007, 10:45
Set a Qt::FramelessWindowHint flag for your widget (it doesn't have to be a dialog, unless you need the local event loop).