[PyKDE] sip: C++ virtual methods

Phil Thompson phil at riverbankcomputing.co.uk
Wed Sep 24 20:11:01 BST 2003

On Wednesday 24 September 2003 6:04 pm, Patrick Stinson wrote:
> in progression:
> Does the %ConvertToSubClassCode directive require some sort of class
> identification mechanism to be written into the original cpp library code?
> QEvent returns an enumerated value in type(), as well ass QApplication and
> some others, and QObject has QObject::className() that returns a string
> identifier. that can be used in conjuction with sipMapStringToClass() and a
> sipStringTypeClassMap struct.

Yes, although sipMapStringToClass() is just a helper for when the RTTI is a 
string. sipMapIntToClass() exists as well, or you can do something entirely 
different with your own code.

> Does this mean I have to modify my cpp library to add some sort of class
> identifier for classs/subclasses if I want polymorphic return values in my
> python functions?

Or use the standard C++ RTTI stuff.


More information about the PyQt mailing list