[PyQt] sip & dynamic_cast

Phil Thompson phil at riverbankcomputing.com
Tue Jun 30 08:05:32 BST 2009

On Mon, 29 Jun 2009 17:54:20 -0400, Hazen Babcock <hbabcock at mac.com> wrote:
> Hello,
> I have a custom C++ QtWidget (the QtExtWidget in PLplot) that I am 
> attempting to wrap with sip. I've run into a very puzzling problem where 
> in one function in the program dynamic_cast will properly recognize the 
> PyQt generated C++ widget and in another function it will not. Also, 
> forcing the cast seems to work, so it seems that the C++ widget is as 
> expected. Suggestions as to what might be going wrong would be
> Also, when wrapping an object with sip do I need to specify all of its 
> member functions and variables? Or just those that I plan to use? 
> Perhaps the problem is that my current sip file doesn't not exactly 
> match the corresponding c++ definition?

Generally you do not need to be honest with SIP. The main exception is any
reimplementations of virtuals defined in super-classes.


More information about the PyQt mailing list