PDA

View Full Version : closing of window on pressing ESC key



raghvendramisra
5th January 2008, 07:24
Hi,

i my application my dialog window closes on pressing the ESC key.

But i don't want it to be like that.
how can i disable the Esc button????????????????

Regards

jpn
5th January 2008, 09:48
But that's the standard way how dialogs work. The question is, what features of QDialog are you actually using? Maybe it shouldn't be a dialog after all but an usual window?

From QDialog docs:


Escape Key
If the user presses the Esc key in a dialog, QDialog::reject() will be called. This will cause the window to close: the closeEvent cannot be ignored.

Ugly workaround: catch or filter the event. Better solution: use a plain QWidget instead.

raghvendramisra
7th January 2008, 02:36
thnx ,
actually i switched from dialog to widget and my problem is solved :)

Regards