[Qt-interest] AutoConnection and Threads

Thiago Macieira thiago at kde.org
Tue Oct 25 10:21:36 CEST 2011


On Tuesday, 25 de October de 2011 09.44.35, elizabeta petreska wrote:
> So I understand that  thread affinity of the sender is not important in the
> resolution of an AutoConnection, the important thing in resolution is in
> which thread the signal is emitted, right ?

Correct.

> So, I have sender object that is created in thread other than the main
> thread, and a receiver object that is created in main thread, and they are
> connected with AutoConnection. However, the sender emits the event in the
> main thread, so the type of connection should be resolved to direct, and the
> reciver slot should be invoked directly. However this is not the case, i.e
> the AutoConnection is resolved as queued and the slot is executed next time
> the main event loop gets control. Why is this ? Can someone explain this.
> 
> I see this behavior in Qt 4.7.4 and also in Qt 4.5

Your diagnosis is probably wrong. I guess you're not emitting the signal from 
the thread you think you're doing it.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      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/20111025/79280058/attachment.bin 


More information about the Qt-interest-old mailing list