I am trying to iterate over a part of a QTreeWidget. So I use a QTreeWidgetItemIterator and the constructor with a QTreeWidgetItem. But the iterator does not visit only the item and its children but "ascend" and continue after the given item.
QTreeWidgetItem *root = topLevelItem(0);
QTreeWidgetItemIterator it(root);
while (*it)
{
qDebug() << (*it)->text(0);
++it;
}
So I obtain this instead of having only 1x nodes.
node1
node11
node12
node2
node21
Is it normal ? Is it possible to use this iterator to iterate on a node ?
Thanks.