summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2010-11-15 05:54:30 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2010-11-15 05:54:30 (GMT)
commitcb25091049daf3f94445c6165d924f49f94325ab (patch)
treead424375f6d5dd4c3bf0127f0b6826bec729443e
parentb60d1cee999ff01a93521e831a2c58679559382e (diff)
parent7f00736ab2c4471fb11c12505f905526fa86c059 (diff)
downloadQt-cb25091049daf3f94445c6165d924f49f94325ab.zip
Qt-cb25091049daf3f94445c6165d924f49f94325ab.tar.gz
Qt-cb25091049daf3f94445c6165d924f49f94325ab.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp54
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/testtypes.h2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/testtypes.h2
3 files changed, 22 insertions, 36 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index 94b1cb3..c7b027d 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -1161,30 +1161,35 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m
int oldDuration = fixupDuration;
fixupDuration = moveReason == Mouse ? fixupDuration : 0;
- if (snapMode != QDeclarativeListView::NoSnap) {
+ if (currentItem && haveHighlightRange && highlightRange == QDeclarativeListView::StrictlyEnforceRange) {
+ updateHighlight();
+ qreal pos = currentItem->itemPosition();
+ qreal viewPos = position();
+ if (viewPos < pos + currentItem->itemSize() - highlightRangeEnd)
+ viewPos = pos + currentItem->itemSize() - highlightRangeEnd;
+ if (viewPos > pos - highlightRangeStart)
+ viewPos = pos - highlightRangeStart;
+
+ timeline.reset(data.move);
+ if (viewPos != position()) {
+ if (fixupDuration)
+ timeline.move(data.move, -viewPos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2);
+ else
+ timeline.set(data.move, -viewPos);
+ }
+ vTime = timeline.time();
+ } else if (snapMode != QDeclarativeListView::NoSnap) {
FxListItem *topItem = snapItemAt(position()+highlightRangeStart);
FxListItem *bottomItem = snapItemAt(position()+highlightRangeEnd);
qreal pos;
- if (topItem && bottomItem && haveHighlightRange && highlightRange == QDeclarativeListView::StrictlyEnforceRange) {
- qreal topPos = qMin(topItem->position() - highlightRangeStart, -maxExtent);
- qreal bottomPos = qMax(bottomItem->position() - highlightRangeEnd, -minExtent);
- pos = qAbs(data.move + topPos) < qAbs(data.move + bottomPos) ? topPos : bottomPos;
- } else if (topItem) {
+ if (topItem) {
pos = qMax(qMin(topItem->position() - highlightRangeStart, -maxExtent), -minExtent);
} else if (bottomItem) {
- pos = qMax(qMin(bottomItem->position() - highlightRangeStart, -maxExtent), -minExtent);
+ pos = qMax(qMin(bottomItem->position() - highlightRangeStart, -maxExtent), -minExtent);
} else {
fixupDuration = oldDuration;
return;
}
- if (currentItem && haveHighlightRange && highlightRange == QDeclarativeListView::StrictlyEnforceRange) {
- updateHighlight();
- qreal currPos = currentItem->itemPosition();
- if (pos < currPos + currentItem->itemSize() - highlightRangeEnd)
- pos = currPos + currentItem->itemSize() - highlightRangeEnd;
- if (pos > currPos - highlightRangeStart)
- pos = currPos - highlightRangeStart;
- }
qreal dist = qAbs(data.move + pos);
if (dist > 0) {
@@ -1195,25 +1200,6 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m
timeline.set(data.move, -pos);
vTime = timeline.time();
}
- } else if (haveHighlightRange && highlightRange == QDeclarativeListView::StrictlyEnforceRange) {
- if (currentItem) {
- updateHighlight();
- qreal pos = currentItem->itemPosition();
- qreal viewPos = position();
- if (viewPos < pos + currentItem->itemSize() - highlightRangeEnd)
- viewPos = pos + currentItem->itemSize() - highlightRangeEnd;
- if (viewPos > pos - highlightRangeStart)
- viewPos = pos - highlightRangeStart;
-
- timeline.reset(data.move);
- if (viewPos != position()) {
- if (fixupDuration)
- timeline.move(data.move, -viewPos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2);
- else
- timeline.set(data.move, -viewPos);
- }
- vTime = timeline.time();
- }
} else {
QDeclarativeFlickablePrivate::fixup(data, minExtent, maxExtent);
}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
index 40451c3..15c310f 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
+++ b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
@@ -92,7 +92,7 @@ class MyQmlObject : public QObject
Q_PROPERTY(QDeclarativeListProperty<QObject> objectListProperty READ objectListProperty CONSTANT)
Q_PROPERTY(int resettableProperty READ resettableProperty WRITE setResettableProperty RESET resetProperty)
Q_PROPERTY(QRegExp regExp READ regExp WRITE setRegExp)
- Q_PROPERTY(int nonscriptable READ nonscriptable WRITE setNonscriptable SCRIPTABLE false);
+ Q_PROPERTY(int nonscriptable READ nonscriptable WRITE setNonscriptable SCRIPTABLE false)
public:
MyQmlObject(): myinvokableObject(0), m_methodCalled(false), m_methodIntCalled(false), m_object(0), m_value(0), m_resetProperty(13) {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/testtypes.h b/tests/auto/declarative/qdeclarativelanguage/testtypes.h
index 2b23a49..f8d785c 100644
--- a/tests/auto/declarative/qdeclarativelanguage/testtypes.h
+++ b/tests/auto/declarative/qdeclarativelanguage/testtypes.h
@@ -112,7 +112,7 @@ class MyQmlObject : public QObject, public MyInterface
Q_PROPERTY(MyCustomVariantType customType READ customType WRITE setCustomType)
Q_PROPERTY(MyQmlObject *qmlobjectProperty READ qmlobject WRITE setQmlobject)
Q_PROPERTY(int propertyWithNotify READ propertyWithNotify WRITE setPropertyWithNotify NOTIFY oddlyNamedNotifySignal)
- Q_PROPERTY(int nonScriptable READ nonScriptable WRITE setNonScriptable SCRIPTABLE false);
+ Q_PROPERTY(int nonScriptable READ nonScriptable WRITE setNonScriptable SCRIPTABLE false)
Q_INTERFACES(MyInterface)
public: