31 #include <QAbstractItemModel>
48 ModelIterator& ModelIterator::operator++ ()
50 ++GetIncrementable ();
54 ModelIterator ModelIterator::operator++ (
int)
56 ModelIterator oldThis (*
this);
57 ++GetIncrementable ();
61 ModelIterator& ModelIterator::operator-- ()
63 --GetIncrementable ();
67 ModelIterator ModelIterator::operator-- (
int)
69 ModelIterator oldThis (*
this);
70 --GetIncrementable ();
74 ModelIterator& ModelIterator::operator+= (
int diff)
76 GetIncrementable () += diff;
80 ModelIterator& ModelIterator::operator-= (
int diff)
82 GetIncrementable () -= diff;
86 int ModelIterator::operator- (
const ModelIterator& other)
const
88 return GetIncrementable () - other.GetIncrementable ();
93 return left.Row_ == right.Row_ &&
94 left.Col_ == right.Col_ &&
95 left.Model_ == right.Model_ &&
96 left.Parent_ == right.Parent_;
101 return !(left == right);
106 return Model_->index (Row_, Col_, Parent_);
109 int ModelIterator::GetRow ()
const
114 int ModelIterator::GetCol ()
const
119 int& ModelIterator::GetIncrementable ()
123 case Direction::Rows:
125 case Direction::Cols:
129 qWarning () << Q_FUNC_INFO
130 <<
"unknown direction";
134 int ModelIterator::GetIncrementable ()
const
138 case Direction::Rows:
140 case Direction::Cols:
144 qWarning () << Q_FUNC_INFO
145 <<
"unknown direction";