PDA

View Full Version : how can I execute some code before mainwindow is close



patcito
1st June 2006, 13:38
Hey all,
I would like to execute a QDialog when the user close the main window of the application (by clicking on the cross at the top right of the window for most people). How could I do that?
thanx in advance

Pat

jpn
1st June 2006, 13:46
Override mainwindow's closeEvent() (http://doc.trolltech.com/4.1/qwidget.html#closeEvent), launch the dialog in there and possibly accept or ignore the event according to the dialog result.