[PyQt] deleting QTreeWidgetItem

Michael Towers gradgrind at online.de
Fri Sep 7 11:43:24 BST 2007


Phil Thompson wrote:
> On Friday 07 September 2007, Michael Towers wrote:
>   
>> Hi all,
>>
>> Could someone confirm (or otherwise!) my understanding of the way PyQt4
>> deals with management of Qt objects? If I want to delete a
>> QTreeWidgetItem and all its children from a tree (and release all
>> connected storage), is it enough to do the following?
>>
>>          p = item.parent()
>>          p.removeChild(item)
>> 	item = None
>>
>> (assuming item is the only python reference to the QTreeWidgetItem).
>>     
>
> Correct.
>
> Phil
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
>   
Thanks, Phil. I'm really enjoying PyQt4!

Best wishes,
mt



More information about the PyQt mailing list