aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den.exter@jollamobile.com>2013-03-05 17:56:21 +1000
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-12 00:43:33 +0100
commit1f6d469df21352eedb01e265eecb0b98b0148d3a (patch)
tree59190239b1da60d3d4bf090ade30f25bb12c3c87 /tests/auto
parent8325f2dead9b5257113d260ab673d51f8891f097 (diff)
Improve the ordering of Flickable dragging and moving property updates.
Move the contentItem after the dragging and moving properties have been updated so they return the correct values from the onContentYChanged and onContentXChanged handlers. Task-number: QTBUG-30032 Change-Id: I15716dc8eee4d9836f96362a8b49f1d0c404b0c2 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/quick/qquickflickable/data/flickable03.qml14
-rw-r--r--tests/auto/quick/qquickflickable/tst_qquickflickable.cpp8
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickflickable/data/flickable03.qml b/tests/auto/quick/qquickflickable/data/flickable03.qml
index a3e9d6fd59..1549034576 100644
--- a/tests/auto/quick/qquickflickable/data/flickable03.qml
+++ b/tests/auto/quick/qquickflickable/data/flickable03.qml
@@ -1,9 +1,23 @@
import QtQuick 2.0
Flickable {
+ property bool movingInContentX: true
+ property bool movingInContentY: true
+ property bool draggingInContentX: true
+ property bool draggingInContentY: true
+
width: 100; height: 400
contentWidth: column.width; contentHeight: column.height
+ onContentXChanged: {
+ movingInContentX = movingInContentX && movingHorizontally
+ draggingInContentX = draggingInContentX && draggingHorizontally
+ }
+ onContentYChanged: {
+ movingInContentY = movingInContentY && movingVertically
+ draggingInContentY = draggingInContentY && draggingVertically
+ }
+
Column {
id: column
Repeater {
diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
index 57c4c12264..c4f871fc11 100644
--- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
+++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
@@ -647,6 +647,9 @@ void tst_qquickflickable::movingAndFlicking()
QVERIFY(flickable->isFlicking());
QCOMPARE(flickable->isFlickingHorizontally(), horizontalEnabled);
QCOMPARE(flickable->isFlickingVertically(), verticalEnabled);
+ // contentX/contentY are either unchanged, or moving is true when the value changed.
+ QCOMPARE(flickable->property("movingInContentX").value<bool>(), true);
+ QCOMPARE(flickable->property("movingInContentY").value<bool>(), true);
QCOMPARE(moveSpy.count(), 1);
QCOMPARE(vMoveSpy.count(), verticalEnabled ? 1 : 0);
@@ -810,6 +813,11 @@ void tst_qquickflickable::movingAndDragging()
QVERIFY(flickable->isDragging());
QCOMPARE(flickable->isDraggingHorizontally(), horizontalEnabled);
QCOMPARE(flickable->isDraggingVertically(), verticalEnabled);
+ // contentX/contentY are either unchanged, or moving and dragging are true when the value changes.
+ QCOMPARE(flickable->property("movingInContentX").value<bool>(), true);
+ QCOMPARE(flickable->property("movingInContentY").value<bool>(), true);
+ QCOMPARE(flickable->property("draggingInContentX").value<bool>(), true);
+ QCOMPARE(flickable->property("draggingInContentY").value<bool>(), true);
QCOMPARE(moveSpy.count(), 1);
QCOMPARE(vMoveSpy.count(), verticalEnabled ? 1 : 0);