 |
LeechCraft
0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
|
Go to the documentation of this file.
10 #include <QAbstractItemModel>
27 ++GetIncrementable ();
34 ++GetIncrementable ();
40 --GetIncrementable ();
47 --GetIncrementable ();
53 GetIncrementable () += diff;
59 GetIncrementable () -= diff;
65 return GetIncrementable () - other.GetIncrementable ();
70 return left.Row_ == right.Row_ &&
71 left.Col_ == right.Col_ &&
72 left.Model_ == right.Model_ &&
73 left.Parent_ == right.Parent_;
76 bool operator!= (
const ModelIterator& left,
const ModelIterator& right)
78 return !(left == right);
83 return Model_->index (Row_, Col_, Parent_);
96 int& ModelIterator::GetIncrementable ()
106 qWarning () << Q_FUNC_INFO
107 <<
"unknown direction";
111 int ModelIterator::GetIncrementable ()
const
121 qWarning () << Q_FUNC_INFO
122 <<
"unknown direction";
bool operator!=(const ModelIterator &left, const ModelIterator &right)
ModelIterator & operator++()
Increments the traversable index and returns the modified iterator.
ModelIterator & operator+=(int count)
Adds the given count to the traversable index.
int GetRow() const
Returns the current row.
int GetCol() const
Returns the current column.
Provides an iterator-based API to a Qt model.
ModelIterator & operator-=(int count)
Subtracts the given count to the traversable index.
QModelIndex operator*() const
Returns the index currently pointed by the iterator.
int operator-(const ModelIterator &other) const
Computes the distance between this and another iterator.
ModelIterator & operator--()
Decrements the traversable index and returns the modified iterator.
bool operator==(const ModelIterator &left, const ModelIterator &right)
@ Rows
The model should be traversed by rows.
Direction
The direction of traversal.
@ Cols
The model should be traversed by columns.
ModelIterator(QAbstractItemModel *model, int row, int col=0, Direction dir=Direction::Rows, const QModelIndex &parent={})
Constructs an iterator.