PDA

View Full Version : Signal-Signal Connections Between Threads



PhilippB
15th December 2008, 16:29
Hi,

I'm wondering how signal-to-signal connections are handled internally, when every involved object's message loop is run by its own thread.

I have three objects, connected like this:
Object A signal() --> Object B signal() --> Object C slot()

Object B is bound to the GUI thread, while Object A and Object C have both private threads.

Is Object B's message loop needed for signal forwarding? I would prefer Qt's signal/slot implementation to handle this internally by connecting Object A directly to Object C...

thanks,
Philipp

caduel
15th December 2008, 17:06
there's always the (open) source so you may check that :cool:

tinsuke
15th December 2008, 18:27
By default, the Object B slot processing that fires the signal to the Object C, will be delivered during the GUI thread. But you can specify a flag on your QObject::connect call to do the handling immediatly, indenpendanf of the involved objects owner threads. Take a look at http://doc.trolltech.com/4.4/threads.html#signals-and-slots-across-threads for further explanations.

Best Regards