Mani Kanta
Mani Kanta

Reputation: 67

Iterate over expanded nodes of QTreeWidget

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?

Upvotes: 0

Views: 324

Answers (1)

demonplus
demonplus

Reputation: 5801

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()

Upvotes: 2

Related Questions