diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-03-02 13:49:11 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-03-02 13:49:11 +0100 |
commit | 32c1212f81fcfc7b5e49f85d68b05cd94cd90521 (patch) | |
tree | 795a3175173285f4ba5bd15cdc7ae6ec11c556d2 /tests/auto/quick/qquickflickable | |
parent | 79d3fe1bba4589c7f5780bb505eac7872061ee32 (diff) | |
parent | 78dd18a0cd18449e1289e428ea6eca65e28fb114 (diff) |
Merge remote-tracking branch 'origin/dev' into wip/pointerhandler
Change-Id: I7e43a0a47d49de38617f6afc7548f9a9e212a851
Diffstat (limited to 'tests/auto/quick/qquickflickable')
-rw-r--r-- | tests/auto/quick/qquickflickable/data/hide.qml | 13 | ||||
-rw-r--r-- | tests/auto/quick/qquickflickable/tst_qquickflickable.cpp | 20 |
2 files changed, 33 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickflickable/data/hide.qml b/tests/auto/quick/qquickflickable/data/hide.qml new file mode 100644 index 0000000000..ab520549e2 --- /dev/null +++ b/tests/auto/quick/qquickflickable/data/hide.qml @@ -0,0 +1,13 @@ +import QtQuick 2.0 + +Flickable { + id: flickable + width: 200; height: 200 + contentWidth: 400; contentHeight: 400 + + MouseArea { + objectName: "mouseArea" + width: 400; height: 400 + onDoubleClicked: flickable.visible = false + } +} diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp index 1ad691d1c1..9ead271bfe 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(); @@ -1425,6 +1426,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); |