[Qt-interest] Correct way of connecting to the QCoreApplication::aboutToQuit() signal ?

Julien Cugnière julien.cugniere at gmail.com
Mon Feb 8 19:09:00 CET 2010


Hello all,

The documentation mentions that one should connect to the
QCoreApplication::aboutToQuit() signal in order to handle last minute
cleanup when the application closes.

However, can I connect to this signal a slot that doesn't live in the main
thread ? I'm basically afraid that if I connect with the default connection
type (Qt::AutoConnection), Qt will not wait for my slot to finish before
quitting the application... So, given that I don't know from which thread
this signal will be fired, do I need to connect to it using
Qt::DirectConnection, or Qt::BlockingQueuedConnection ?

Any insight appreciated !

NB : I know there are other way to achieve what I want, such as intercepting
QCloseEvent, but I'm more interested in understanding the way aboutToQuit()
is supposed to work.

-- 
Julien Cugnière
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100208/22f99fd3/attachment.html 


More information about the Qt-interest-old mailing list