[Qt-interest] Qt signaling smarts...

Thiago Macieira thiago at kde.org
Tue Nov 24 22:58:33 CET 2009


Em Terça-feira 24. Novembro 2009, às 22.30.26, Gordon Schumacher escreveu:
> Thiago Macieira wrote:
> > Remember that an auto connection is queued if the target object is in a 
> > different thread. If objects B and C are in the main thread, and you have
> > the  connection A→B→C and you emit A's signal in the auxiliary thread, it
> > would originally cause the first connection to be queued and the second
> > one would be DirectConnection. If you force the first one to be direct,
> > B's signal is emitted in the auxiliary thread. Buy then the second
> > connection becomes queued because C is in a different thread.
> >   
> 
> Ah - I think I over-complexified my idea of what was going on; I was
> imagining that B was the QApp thread, and A and C were each in their own
> threads.

Still no problem, but it would avoid the first queued connection.

The only problem is if B is connected to an object that belongs to the current 
thread. In that case, we'll have two direct connections instead of two queued.

-- 
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/20091124/fac1d97a/attachment.bin 


More information about the Qt-interest-old mailing list