PDA

View Full Version : How to control the exiting process of my application ?



tonnot
7th July 2011, 09:41
I have this line to control if the application is going to be finished,

connect(QApplication::instance(), SIGNAL(aboutToQuit()),this,SLOT(control_quit()));
control_quit show a confirmation message.
I have two problems :
1.- The main window (where I have the connect...) dissapears during the proccess. How can avoid this ?
2.-How can I cancel the exiting ?
Thanks

meazza
7th July 2011, 09:55
The signal is particularly useful if your application has to do some last-second cleanup. Note that no user interaction is possible in this state.

Dont think you can abort the exiting after it is emited. Why not use QWidget::closeEvent?

tonnot
7th July 2011, 10:20
Of course. Thanks!