[PyQt] inheriting QTreeWidgetItem Question

Darryl Wallace darryl.wallace at prosensus.ca
Thu Nov 12 20:15:36 GMT 2009


> So I have this now:
> class A(QTreeWidgetItem):
>    def __init__(self, parent):
>        QTreeWidgetItem.__init__(parent)

Try this:
 class A(QTreeWidgetItem):
   def __init__(self, parent=None):
       QTreeWidgetItem.__init__(self, parent)    # the first argument is
always SELF.  The second argument is the superclass' first argument from the
C++ api.

See other PyQt examples for further illustration.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20091112/fea54a0c/attachment.html

More information about the PyQt mailing list