diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-16 17:19:46 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-16 17:19:46 (GMT) |
commit | da2a86555ba79fa67cf98c5985ff64cfdb6b57c7 (patch) | |
tree | 2fe40042e128329c8ad91f18bb1ec70b37da46dc /src | |
parent | 9d174f13e48730ac06aa429e0f011a02b333025e (diff) | |
parent | 42dda19d82ceea48f19d356cfaf2b26acb763df8 (diff) | |
download | Qt-da2a86555ba79fa67cf98c5985ff64cfdb6b57c7.zip Qt-da2a86555ba79fa67cf98c5985ff64cfdb6b57c7.tar.gz Qt-da2a86555ba79fa67cf98c5985ff64cfdb6b57c7.tar.bz2 |
Merge remote branch 'qt/master' into s60-master
Conflicts:
qmake/generators/symbian/symmake.cpp
tests/auto/qlineedit/tst_qlineedit.cpp
tests/benchmarks/benchmarks.pro
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/tools/qstring.h | 2 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicspathview.cpp | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 5e3b0fd..702a21a 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -595,7 +595,7 @@ private: struct Data { QBasicAtomicInt ref; int alloc, size; - ushort *data; + ushort *data; // QT5: put that after the bit field to fill alignment gap; don't use sizeof any more then ushort clean : 1; ushort simpletext : 1; ushort righttoleft : 1; diff --git a/src/declarative/graphicsitems/qmlgraphicspathview.cpp b/src/declarative/graphicsitems/qmlgraphicspathview.cpp index 85e87eb..6718d25 100644 --- a/src/declarative/graphicsitems/qmlgraphicspathview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicspathview.cpp @@ -910,11 +910,16 @@ void QmlGraphicsPathViewPrivate::snapToCurrent() //Rounds is the number of times round to make the current item visible int rounds = itemIndex / items.count(); - int otherWayRounds = (model->count() - (itemIndex)) / items.count() + 1; + int otherWayRounds = (model->count() - (itemIndex)) / items.count(); if (otherWayRounds < rounds) rounds = -otherWayRounds; itemIndex += pathOffset; + if(model->count() % items.count() && itemIndex - model->count() + items.count() > 0){ + //When model.count() is not a multiple of pathItemCount we need to manually + //fix the index so that going backwards one step works correctly. + itemIndex = itemIndex - model->count() + items.count(); + } itemIndex %= items.count(); qreal targetOffset = qmlMod(100 + (snapPos*100) - 100.0 * itemIndex / items.count(), qreal(100.0)); @@ -928,7 +933,7 @@ void QmlGraphicsPathViewPrivate::snapToCurrent() moveOffset.setValue(_offset); if (rounds!=0){ - //Compensate if the targetOffset would bring the target it from off the screen + //Compensate if the targetOffset would bring the target in from off the screen qreal distance = targetOffset - _offset; if (distance <= -50) rounds--; |