[PyQt] qTreeWidgetItemIterator : how it works

Phil Thompson phil at riverbankcomputing.com
Thu May 29 11:47:08 BST 2014

On 29/05/2014 10:59 am, singhai.nish wrote:
> I am able to display data in a qtreewidget form. While reading values ( 
> and
> after googling ), I find qTreeWidgetItemIterator as a way to iterate 
> through
> all the items.
> iterator = QTreeWidgetItemIterator(self.light_write,
> QTreeWidgetItemIterator.All)  where self.light_write is qtreewidget.
> At present above code prints nothing although there is content.
> What is the method to loop through all items in a treewidget using
> QTreeWidgetItemIterator or if their is any other way.

The Python wrapper includes a value() method that returns the 
QTreeWidgetItem instance, ie. it wraps the C++ operator*() method.


More information about the PyQt mailing list