[Qt-interest] signals / slots
Thiago Macieira
thiago at kde.org
Wed Jan 12 02:17:47 CET 2011
On Tuesday, 11 de January de 2011 11:01:07 Michael S wrote:
> Good day all,
>
> I am writing a service type console application and decided to use signals /
> slots for event notifications. I have a few times of events. Some are
> scheduled with QTimer objects, some are external. I was wondering if the
> emitted signals get queued somewhere, in case 2 of them overlap and the
> first slot takes a long time to complete. In other words I want to make
> sure than no signals are lost.
No signals are ever lost.
It seems you misunderstand how signals and slots work. There's nothing
asynchronous, there are no other threads (other than what you start).
Signals and slots[*] are nothing more than a glorified callback mechanism. When
you emit a signal, it's like you were calling each and every slot, in
sequence. So there's simply no way another signal can intervene and stop the
processing.
You can have a signal be emitted from inside a slot, but it's like a different
callback is being invoked.
[*] this can change with queued connections, but it doesn't seem this concept
is relevant here.
--
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/20110111/f1854f7d/attachment.bin
More information about the Qt-interest-old
mailing list