PDA

View Full Version : Finalization on system shutdown



nomadoro
29th October 2009, 17:04
Hi!
I'm writing an application using Qt in Ubuntu. Here's my question: when the system is shutting down, does the application receive a notification signal? This is important because I should do some finalization job before exiting, such as saving the configuration file. Specifically, does Qt support this kind of shutdown notification? Thanks in advance.

high_flyer
29th October 2009, 17:17
Yes, the system sends signals you can catch.
http://www.cs.pitt.edu/~alanjawi/cs449/code/shell/UnixSignals.htm

nomadoro
29th October 2009, 20:59
Thanks, but does Qt provide such a notifying signal?

high_flyer
30th October 2009, 13:39
I don't think so, at least I didn't find anything in the docs.
But why do you need it in Qt it self?
Its just few lines of code.

bender86
30th October 2009, 19:30
Have a look here (http://doc.trolltech.com/latest/session.html). You have to implement QApplication::commitData().