[SOLVED] QDialog::closeEvent not fired by Esc-Key
I have subclassed the QDialog and need a preprocessing before a Window closes. It is a modal dialog. I found out that the QDialog::close() and the click on the window X Button fires the closeEvent.
But pessing the Esc-Key does not fire the event.
Why that ?
Hitting Esc is equivalent to calling
done()with appropriate error codes.
Neither of these
close()the window in the closeEvent sense, they merely
Pressing the "X" button calls
close()generates a close event.
As stated in the docs you should implement
done()to do any custom closing behavior.
closeEventshould only be used to store the dialog position if needed.