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

Thiago Macieira thiago at kde.org
Mon Feb 8 23:08:10 CET 2010


Em Segunda-feira 8. Fevereiro 2010, às 22.11.28, Julien Cugnière escreveu:
> 2010/2/8 Thiago Macieira <thiago at kde.org>
> 
> > Em Segunda-feira 8. Fevereiro 2010, às 19.09.00, Julien Cugnière escreveu:
> > > 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 ?
> > 
> > The signal will be fired from the main thread.
> 
> Ah, thank you ! That's the bit of information I was missing.
> 
> If this is guaranteed behavior, maybe it should be put in the
> documentation, as I was afraid this signal might be emitted by some
> background thread monitoring system events (can we propose
> documentation improvements via Git ? :-). Or should I take for granted
> that because the qApp object belongs to the main thread, all its
> signals will be emitted from there, whatever the platform ?

It's QCoreApplication::aboutToQuit() right?

Then it's emitted from QCoreApplication's thread, which by definition is the 
main/GUI thread.

If a signal is emitted from outside an object's thread, that will probably be 
noted in the documentation. Otherwise, you should assume it behaves like 
expected: it's emitted from the object's thread.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100209/97720e94/attachment.bin 


More information about the Qt-interest-old mailing list