9
9
** $QT_BEGIN_LICENSE:LGPL$
10
10
** Commercial Usage
11
** Licensees holding valid Qt Commercial licenses may use this file in
12
** accordance with the Qt Solutions Commercial License Agreement provided
13
** with the Software or, alternatively, in accordance with the terms
11
** Licensees holding valid Qt Commercial licenses may use this file in
12
** accordance with the Qt Commercial License Agreement provided with
13
** the Software or, alternatively, in accordance with the terms
14
14
** contained in a written agreement between you and Nokia.
16
16
** GNU Lesser General Public License Usage
33
33
** ensure the GNU General Public License version 3.0 requirements will be
34
34
** met: http://www.gnu.org/copyleft/gpl.html.
36
** Please note Third Party Software included with Qt Solutions may impose
37
** additional restrictions and it is the user's responsibility to ensure
38
** that they have met the licensing requirements of the GPL, LGPL, or Qt
39
** Solutions Commercial license and the relevant license of the Third
40
** Party Software they are using.
42
36
** If you are unsure which license is appropriate for your use, please
43
37
** contact the sales department at qt-sales@nokia.com.
44
38
** $QT_END_LICENSE$
194
struct const_row_iterator
196
const_row_iterator() {}
197
const_row_iterator(QVector<QVariant>::const_iterator begin, int width)
198
: begin(begin), width(width) {}
200
bool operator != (const const_row_iterator &other) const { return begin != other.begin; }
201
bool operator <(const const_row_iterator &other) const { return begin < other.begin; }
203
const_row_iterator &operator ++() { begin += width; return *this; }
204
const_row_iterator operator --(int) {
205
const_row_iterator n(*this); begin -= width; return n; }
207
int operator -(const const_row_iterator &other) const {
208
return (begin - other.begin) / width; }
209
int operator -(const QVector<QVariant>::const_iterator &iterator) const {
210
return (begin - iterator) / width; }
212
const_row_iterator operator +(int span) const {
213
return const_row_iterator(begin + (span * width), width); }
215
const_row_iterator &operator +=(int span) { begin += span * width; return *this; }
217
bool isEqual(const const_row_iterator &other, int count) const {
218
return qEqual(begin, begin + count, other.begin); }
219
bool isEqual(const const_row_iterator &other, int index, int count) {
220
return qEqual(begin + index, begin + count, other.begin + index); }
222
QVector<QVariant>::const_iterator begin;
202
228
Cache() : count(0), cutoff(0) {}
309
335
QBasicTimer updateTimer;
310
336
SyncEventQueue syncEvents;
312
inline int rCacheIndex(const row_iterator &iterator) const {
338
inline int rCacheIndex(const const_row_iterator &iterator) const {
313
339
return iterator - rCache.values.begin(); }
314
inline int iCacheIndex(const row_iterator &iterator) const {
340
inline int iCacheIndex(const const_row_iterator &iterator) const {
315
341
return iterator - iCache.values.begin(); }