[Qt-interest] Qt::AutoConnection fails

Thiago Macieira thiago.macieira at trolltech.com
Tue Apr 14 14:37:14 CEST 2009


Em Terça-feira 14 Abril 2009, às 11:25:48, Oliver.Knoll at comit.ch escreveu:
> First off, it is important to realise that Qt::AutoConnect decides at
> *connection time* whether Qt::QueuedConnection or Qt::DirectConnection has
> to be used. It does this by comparing the threads
> (http://doc.trolltech.com/4.5/qobject.html#thread) to which the QObject
> based object is associated with, at the point where connect() is called. If
> both objects reside in the same thread, then Qt::DirectConnection will be
> used, otherwise Qt::QueuedConnection.

That's actually incorrect.

The decision on whether to queue or to deliver directly in the case of an 
AutoConnection is done at emission time, not at connection time. If either the 
sender or receiver belong to another thread, the emission is queued.

-- 
Thiago Macieira - thiago.macieira (AT) nokia.com
  Senior Product Manager - Nokia, Qt Software
     Sandakerveien 116, NO-0402 Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090414/d1facbea/attachment.bin 


More information about the Qt-interest-old mailing list