22 : _current(nullptr), _model(model)
66 while (!
next && parent)
Definition of the TreeItem class.
Definition of the TreeModelIterator class.
Definition of the TreeModel class.
Objects nodes for the TreeModel.
virtual int childCount() const
TreeItem * parentItem() const
TreeItem * child(int row) const
TreeModelIterator provides a way to iterate over TreeItems in a TreeModel. Usage:
TreeItem * next(const TreeItem *current)
The traversal implementation.
TreeModelIterator(TreeModel *model)
Constructor. Provide a tree model to iterate over.
QStack< int > _parentIndex
Stack to save the child indices of the parent TreeItems.
TreeModel * _model
The model to iterate over.
TreeItem * operator*() const
Dereferencing the iterator to retrieve the current TreeItem. Returns nullptr if the iterator is at th...
int _currentIndex
The current child index.
TreeItem * _current
The current TreeItem.
TreeModelIterator & operator++()
Advance the iterator to the next TreeItem.
A hierarchical model for a tree implemented as a double-linked list.
TreeItem * rootItem() const