[Qt-interest] QThread Question

Thiago Macieira thiago.macieira at trolltech.com
Thu Aug 6 14:44:51 CEST 2009


Em Quinta-feira 06 Agosto 2009, às 13:51:44, Bradley T. Hughes escreveu:
> If you want to check if 2 objects have the same thread affinity, it's
> enough to compare the QThread pointers returned by QObject::thread(). For
> example:
>
>      if (object->thread() != qApp->thread())
>          qFatal("PANIC");

http://qt.gitorious.org/qt/qt/blobs/master/src/dbus/qdbusintegrator.cpp#line748
      Q_ASSERT_X(QThread::currentThread() == object->thread(),
                 "QDBusConnection: internal threading error",
                 "function called for an object that is in another thread!!");

:-)

-- 
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/20090806/ea265c8c/attachment.bin 


More information about the Qt-interest-old mailing list