32 const QAbstractItemModel *Model_ =
nullptr;
65 ModelIterator (
const QAbstractItemModel *model,
int row,
int col = 0,
66 Direction dir = Direction::Rows,
const QModelIndex& parent = {});
73 ModelIterator& operator++ ();
80 ModelIterator operator++ (
int);
87 ModelIterator& operator-- ();
94 ModelIterator operator-- (
int);
101 ModelIterator& operator+= (
int count);
109 ModelIterator& operator-= (
int count);
123 int operator- (
const ModelIterator& other)
const;
142 QModelIndex operator* ()
const;
160 Direction GetDirection ()
const;
162 int& GetIncrementable ();
163 int GetIncrementable ()
const;
189 .End_ = { model.rowCount () },
204struct std::iterator_traits<
LC::Util::ModelIterator>
212static_assert (std::ranges::input_range<LC::Util::ModelRange>);
Provides an iterator-based API to a Qt model.
ModelIterator(const QAbstractItemModel *model, int row, int col=0, Direction dir=Direction::Rows, const QModelIndex &parent={})
Constructs an iterator.
Direction
The direction of traversal.
@ Rows
The model should be traversed by rows.
@ Cols
The model should be traversed by columns.
auto operator==(const T &left, const T &right)
ModelRange ModelRows(const QAbstractItemModel &model, int from, int to, int column=0)
bool operator==(const ModelIterator &left, const ModelIterator &right)
ModelRange AllModelRows(const QAbstractItemModel &model, int column=0)
const ModelIterator Begin_
random_access_iterator_tag iterator_category