[PyQt] SIP: Subclassing QMdiSubWindow

Florian Kamm florian.kamm at gmx.de
Thu Apr 3 12:38:27 BST 2008


Hi,

the QtiPlot project actually uses pyQt and SIP for its python bindings. 
Among others, the 'Table' class is prepared to be accessed from python. 
It inherits from QMdiSubWindow and another class not related to Qt.
The code below creates a new Table instance, but obviously python 
supposes it to be a QMdiSubWindow object.

[...]
t = newTable()
print t.__class__

results in:
<class 'PyQt4.QtGui.QMdiSubWindow'>

So, it is not recognized as Table object and thus has no table specific 
attributes.
[...]

Is this related to a problem with the %ConvertToSubClassCode macro since 
a Table instance is not casted correctly and falls back to the base class?
How is subclassing handled correctly by SIP especially in that case? 
Could one give me an example?

Regards

Florian



More information about the PyQt mailing list