aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
diff options
context:
space:
mode:
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 942e99018f..2555322e3e 100644
--- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
+++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
@@ -80,6 +80,7 @@ private slots:
void disabled();
void flickVelocity();
void margins();
+ void cancelOnHide();
void cancelOnMouseGrab();
void clickAndDragWhenTransformed();
void flickTwiceUsingTouches();
@@ -1422,6 +1423,25 @@ void tst_qquickflickable::margins()
delete root;
}
+void tst_qquickflickable::cancelOnHide()
+{
+ QScopedPointer<QQuickView> window(new QQuickView);
+ window->setSource(testFileUrl("hide.qml"));
+ QTRY_COMPARE(window->status(), QQuickView::Ready);
+ QQuickViewTestUtil::centerOnScreen(window.data());
+ QQuickViewTestUtil::moveMouseAway(window.data());
+ window->show();
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
+ QVERIFY(window->rootObject());
+
+ QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(window->rootObject());
+ QVERIFY(flickable);
+
+ QTest::mouseDClick(window.data(), Qt::LeftButton);
+ QVERIFY(!flickable->isVisible());
+ QVERIFY(!QQuickFlickablePrivate::get(flickable)->pressed);
+}
+
void tst_qquickflickable::cancelOnMouseGrab()
{
QScopedPointer<QQuickView> window(new QQuickView);