ListView's highlightMoveDuration should default to -1.
authorMichael Brasser <michael.brasser@live.com>
Thu, 21 Feb 2013 14:46:56 +0000 (08:46 -0600)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 22 Feb 2013 13:35:10 +0000 (14:35 +0100)
Change-Id: Ibb53cc21b4f1f301569cd7724c60cb8df978921a
Reviewed-by: Bea Lam <bea.lam@jollamobile.com>

src/quick/items/qquicklistview.cpp
tests/auto/quick/qquicklistview/tst_qquicklistview.cpp

index 57f1b99..63528ff 100644 (file)
@@ -172,7 +172,9 @@ public:
         , highlightMoveVelocity(400), highlightResizeVelocity(400), highlightResizeDuration(-1)
         , sectionCriteria(0), currentSectionItem(0), nextSectionItem(0)
         , overshootDist(0.0), correctFlick(false), inFlickCorrection(false)
-    {}
+    {
+        highlightMoveDuration = -1; //override default value set in base class
+    }
     ~QQuickListViewPrivate() {
         delete highlightPosAnimator;
         delete highlightSizeAnimator;
index 9fad01e..c034fe8 100644 (file)
@@ -206,6 +206,7 @@ private slots:
     void destroyItemOnCreation();
 
     void parentBinding();
+    void defaultHighlightMoveDuration();
 
 private:
     template <class T> void items(const QUrl &source, bool forceLayout);
@@ -6801,6 +6802,18 @@ void tst_QQuickListView::parentBinding()
     delete window;
 }
 
+void tst_QQuickListView::defaultHighlightMoveDuration()
+{
+    QQmlEngine engine;
+    QQmlComponent component(&engine);
+    component.setData("import QtQuick 2.0; ListView {}", QUrl::fromLocalFile(""));
+
+    QObject *obj = component.create();
+    QVERIFY(obj);
+
+    QCOMPARE(obj->property("highlightMoveDuration").toInt(), -1);
+}
+
 QTEST_MAIN(tst_QQuickListView)
 
 #include "tst_qquicklistview.moc"