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

Mandeep Sandhu mandeepsandhu.chd at gmail.com
Mon Mar 21 07:30:03 CET 2011


Hi All,

Sometime back I had a requirement where I didn't want ppl using my
class's signals to connect to them directly. Currently if you do 'emit
mySignal()', it's upto to the class that uses this signal, to decide
how it would like to connect to it.

For forcing a queued a connection, I thought of the following approach:

connect(this, SIGNAL(myInternalSignal(), this, SIGNAL(mySignal()),
Qt::QueuedConnection);

Basically I'm chaining my signal and re-emitting it with the queued
connection type (I've yet to verify this code though).

How can one verify if the slot is indeed called in a queued connection?

Thanks,
-mandeep



More information about the Qt-interest-old mailing list