Several webpages say that QTreeWidgetItem
can be deleted by deleting or QTreeWidget.clear
ing. But my code sample below doesn\'t seem to do so. Am I doi
By calling del i
you are just deleting the reference not the actual C++ Object(referent) it refers to, not the object itself.
Change your TreeWidgetItemChild.__del__
function to:
def __del__(self):
treeWidget = self.treeWidget()
#removing the QTreeItemWidget object
treeWidget.takeTopLevelItem(treeWidget.indexOfTopLevelItem(self))
print 'TreeWidgetItemChild del'