aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@live.com>2015-07-21 14:31:19 -0500
committerMichael Brasser <michael.brasser@live.com>2015-07-22 17:58:00 +0000
commita4498f155085ab47d3c7a81ab318d9be7bb7fad3 (patch)
tree5f7243c59353d4057678bc85eb620178036b1eb9 /tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
parent5ba31c335d3e3e14aaa9ba1c7e236b0ba300ce0f (diff)
Emit movement signals for flick().
Make flick() more like a real flick and ensure the movement signals and properties are updated. This allows them to be handled from QML. This also fixes issues with flick() and dynamic delegates. Flickable has several checks of the form: !d->pressed && !d->hData.moving && !d->vData.moving That were processed incorrectly for flick(), as the moving variables were not being updated. [ChangeLog][QtQuick][Flickable] The movement related signals and properties are now updated for flicks started via the flick function. Change-Id: I7e96e2e12a4d0a0ee73ddd6f29d95f19c44667b0 Task-number: QTBUG-34507 Reviewed-by: Martin Jones <martin.jones@qinetic.com.au>
Diffstat (limited to 'tests/auto/quick/qquickflickable/tst_qquickflickable.cpp')
-rw-r--r--tests/auto/quick/qquickflickable/tst_qquickflickable.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
index 44da9a64e5..d6c1fd6eea 100644
--- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
+++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
@@ -91,6 +91,7 @@ private slots:
void stopAtBounds_data();
void nestedMouseAreaUsingTouch();
void pressDelayWithLoader();
+ void movementFromProgrammaticFlick();
void cleanup();
private:
@@ -1719,6 +1720,25 @@ void tst_qquickflickable::pressDelayWithLoader()
QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(150, 150));
}
+// QTBUG-34507
+void tst_qquickflickable::movementFromProgrammaticFlick()
+{
+ QScopedPointer<QQuickView> window(new QQuickView);
+ window->setSource(testFileUrl("movementSignals.qml"));
+ QTRY_COMPARE(window->status(), QQuickView::Ready);
+ QQuickViewTestUtil::centerOnScreen(window.data());
+ QQuickViewTestUtil::moveMouseAway(window.data());
+ window->show();
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
+
+ QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(window->rootObject());
+ QVERIFY(flickable != 0);
+
+ // verify that the signals for movement and flicking are called in the right order
+ flickable->flick(0, -1000);
+ QTRY_COMPARE(flickable->property("signalString").toString(), QString("msfsfeme"));
+}
+
QTEST_MAIN(tst_qquickflickable)
#include "tst_qquickflickable.moc"