[PyQt] Problems with new-style signal/slot syntax

Baz Walter bazwal at ftml.net
Wed Apr 10 23:13:11 BST 2013


On 09/04/13 22:19, Phil Thompson wrote:
> On Tue, 09 Apr 2013 21:06:44 +0100, Baz Walter <bazwal at ftml.net> wrote:
>> After a bit of trial and error, it seems that signatures with "plain" or
>
>> "const" arguments work okay, but the ones with "pointer" arguments
>> don't. That is, unless the full C++ signature is used, in which case it
>> always works:
>>
>>       m.triggered['QAction *']
>>       <bound signal triggered of QMenu object at 0x2512b00>
>>
>>       c.activated['const QString &']
>>       <bound signal activated of QComboBox object at 0x18308c0>
>>
>> (Is it intended that these latter two variants work? It doesn't seem to
>> be documented anywhere).
>
> Qt treats const QString& and plain QString as equivalent as far as signal
> arguments are concerned. However QAction* is different to QAction. A
> QObject derived instance will only ever be passed as a pointer, but that's
> not true for other types. Therefore, for consistency, I think it would be
> wrong to strip the "*". I agree the documentation could be clarified.

Okay, thanks - the current behaviour makes sense now.



More information about the PyQt mailing list