0
votes

I have a QTreeWidget. Have to iterate through the nodes which are expanded. Tried with iterating with QTreeWidgetItemIterator it(<rootNode>, QTreeWidgetItemIterator::NotHidden). But it is giving all the nodes of the tree instead of just expanded ones.

Am I missing to set any flag in the iterator?

1

1 Answers

2
votes

I am afraid there is no specific flag for expanded items (but you can get checked items, for instance, using flags, http://doc.qt.io/qt-4.8/qtreewidgetitemiterator.html).

But you can easily check if item is expanded or not while iterating, using QTreeWidgetItem::isExpanded()