[Qt-interest] Forcing a signal "emit" to be queued

Mandeep Sandhu mandeepsandhu.chd at gmail.com
Mon Mar 21 10:36:52 CET 2011


>> connect(this, SIGNAL(myInternalSignal(), this, SIGNAL(mySignal()),
>> Qt::QueuedConnection);
>
> I guess you can also use QMetaObject::invokeMethod() to queue the signal emission
> or even a QTimer::singleShot() with a 0 timeout.

Ummm...for that I will have to rely on the 'caller' to make the queued
connection (via invokeMethod()). Whereas, I want this to be decided by
the class thats emitting the signal.

-mandeep

>
> The only advantage I can see is not having an extra signal that the users will eventually
> discover and use ;-)

Not if, as Andre pointed out,  I can hide it in a private class! ;)

-mandeep

>
> Cheers,
>
> --
> GPG-Key: 0xA3FD0DF7 - 9F73 032E EAC9 F7AD 951F  280E CB66 8E29 A3FD 0DF7
> Debian User and Developer.
> Homepage: www.foolab.org
>



More information about the Qt-interest-old mailing list