[PyKDE] SIP automatically casting up to a QWidget

Paul Giannaros ceruleanblaze at gmail.com
Fri Feb 23 00:20:56 GMT 2007


On Thursday 22 February 2007 19:20, Giovanni Bajo wrote:
> On 2/22/2007 7:49 PM, Paul Giannaros wrote:
> >>> Nevertheless, I implemented %ConvertToSubClassCode in class A (and
> >>> class B which inherits QWidget) using
> >>> sipMapStringToClass/sipStringTypeClassMap, and a QWidget is still being
> >>> returned.
> >>
> >> Can you show us this code please?
>
> I think Phil should chime in now for the exact details, but I believe
> that the %ConvertToSubClassCode should be put in a class which is part
> of the hierarchy. Do "class View" derive from QObject? If not, you can't
> put that RTTI code in there.

View derives from (amongst many other things) KTextEditor::View, which derives 
from KXMLGUIClient and QWidget, so it does derive from QObject.

>
> Another thing to check is whether sipCpp->className() contains something
> correct and matching any of the sipName_* constants. You can try
> printing sipCpp->className() every time to see if it gets called with
> your widget class.

I'll give that a go. Thanks




More information about the PyQt mailing list