[PyQt] a subclass for a c++ object

Blaine Bell blaine.bell at schrodinger.com
Sat Jun 26 05:17:36 BST 2010


When I subclass a c++ object which is wrapped in SIP, I have found that 
I need to include all functions of that C++ object in the SIP interface 
that are used from within that class (or any of its subclasses).  For 
example, this one class I am using in python subclasses a class that 
subclasses QAbstractProxyModel, and overrides the function 
"Qt::ItemFlags flags(const QModelIndex &index) const;".  I do not use 
this function at all in python, but it doesn't get called unless I 
include it in the SIP interface.  Can someone explain what is happening 
here?  I would think that if that class is being instantiated properly, 
then inside C++ the interface should have all of the functions 
implemented.  Is it possible I am not doing something right here?

Thanks,

Blaine


More information about the PyQt mailing list