On Thu, 12 Nov 2009 10:36:34 -0800 (PST), dizou <[email protected]> wrote: > I am trying to get a class i wrote that inherits QTreeWidgetItem to display > on the QTreeWidget. If I used just the normal QTreeWidgetItem I would have > code like this: > > tree = QTreeWidgetItem(self) > tree.setFlags(...) > tree.setIcon(...) > tree.setText(...) > > However I have a class that inherits the QTreeWidgetItem class: > > class A(QTreeWidgetItem): > def __init__(self): > QTreeWidgetItem.__init__(self) > > Then when I do this: > > tree = A(self) > tree.setFlags(...) > tree.setIcon(...) > tree.setText(...) > > nothing is displayed in the QTreeWidget. What do I have to do to get the > items to be displayed?
You aren't passing a parent to QTreeWidgetItem.__init__() so its probably being garbage collected. Phil _______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
