[PyKDE] SIP automatically casting up to a QWidget

Giovanni Bajo rasky at develer.com
Thu Feb 22 19:20:12 GMT 2007


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.

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.
-- 
Giovanni Bajo




More information about the PyQt mailing list