[PyQt] [SIP] SIP_PYCALLABLE in constructor

Sandro Mani manisandro at gmail.com
Thu Oct 31 10:24:38 GMT 2019


On 31.10.19 11:13, Phil Thompson wrote:
> On 31/10/2019 09:22, Sandro Mani wrote:
>> Hi
>>
>> I'm trying to create bindings for a class Foo with a constructor
>> taking a std::function, so basically for
>>
>>     typedef std::function<Item*()> ItemFactory;
>>     Foo( ItemFactory factory, QObject* parent = 0 );
>>
>> in the sip file I'm writing
>>
>>     Foo( SIP_PYCALLABLE factory, QObject *parent = 0 );
>
> You haven't told SIP what the C++ signature is. You need to do this 
> for ctors, virtuals and protected methods. Something like...
>
>     Foo(SIP_PYCALLABLE factory, QObject *parent = 0) [(ItemFactory, 
> QObject *)];
>
Many thanks!

Sandro



More information about the PyQt mailing list