[PySide] inter-object communications

Henry Gomersall heng at cantab.net
Fri Nov 8 17:01:01 CET 2013


On 08/11/13 15:43, John Ehresman wrote:
> On 11/8/13 10:28 AM, Henry Gomersall wrote:
>> This is a conceptual question, which I'm sure someone more well versed
>> with Qt can answer.
>>
>> Is *all* inter-object communication within Qt handled through the
>> signal-slot mechanism?
>
> No, all inter-object communication is not handled by signal / slots.
> Regular C++ method calls are used.  You may be thinking of gtk, which
> uses its signal mechanism in more places, but even in gtk, not
> everything uses signals / slots.

No, I just wasn't sure. Clearly there are _some_ cases where objects are 
passed directly, which would suggest their methods being called 
directly, but the docs say "Signals and slots are used for communication 
between objects." without much info about how prevalent that is.

>
> PySide uses the ability to subclass C++ classes and to override existing
> virtual methods.  This is done by generating a C++ subclass for each
> class and overriding each method.  In each overridden method, a check is
> done to see if a Python subclass implements the method and to call it if
> it does.

Ah, ok. So PySide creates a parallel class heirarchy, with methods that 
can call back into Python. Out of interest, how is this check on being a 
python implemented subclass performed? (a pointer to the relevant code 
would be awesome!).

Cheers,

Henry



More information about the PySide mailing list