[PyQt] Wrap C++ classes using SIP

Phil Thompson phil at riverbankcomputing.com
Sat May 19 09:53:58 BST 2012


On Fri, 18 May 2012 18:13:37 -0400, Jayesh Chaudhary <aashishcy at gmail.com>
wrote:
> Folks,
> 
> I am a newbie to SIP. I am trying to wrap couple of classes and it was
> going good till I hit this problem.
> 
> So here is my use case:
> 
> Lets say I have two classes Foo and Bar. I already have Bar wrapped (not
> via SIP though) and now I am trying to wrap Foo using SIP.
> 
> My Foo looks like this:
> 
> Class Foo: public Bar
> {
> };
> 
> 
> I don't want to wrap Bar again with SIP since this will trigger a chain
> reaction. In my SIP I have done something like this:
> 
> %Module FooMod
> 
> class Foo: Bar
> {
> %TypeHeaderCode
> #include<Foo.h>
> %End
> ...
> ...
> };
> 
> But then if I don't wrap Bar, I get Bar undefined. Is there a way around
> it?

No, you can't mix binding tools in the same class hierarchy.

Phil


More information about the PyQt mailing list