Hi Eric,

A direct call is always more lightweight, as no matter what else 
happens, somehow in the end a direct call to the slot has to be made.

Based on the 'type' parameter to the connect call, different things 
happen. The emitted signal can simply directly call the slot (default 
behaviour when both sender and receiver live in the same thread), or 
the signal can be stored in an event queue, from where it will be 
delivered later on (default behaviour when sender and receiver live in 
different threads).

Sybren

On Friday 03 September 2010 15:51:44 Eric Frederich wrote:
> I constantly find myself with options like...
> a) create a connection from foo's custom signal to bar's slot....
> or b) when creating the foo object, give it a reference to bar,
> and instead of emitting a custom signal, just call bar's slot
> directly.
> 
> What is more lightweight.... an instance variable or a connection?
> 
> I'm sure this must be common.
> Are there guidelines to use, rules of thumb etc?
> 
> Thanks,
> ~Eric

-- 
Sybren A. Stüvel

[email protected]
http://stuvel.eu/

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to