From feed3b7b8077f2c9bba72c49e249fb96c262d72e Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 1 Nov 2018 10:52:32 +0100 Subject: Drawer: fix infinite positioning loop This fixes the issue where Drawer would try to reposition itself forever, but does not address the fact that it is incorrectly positioned afterwards. Task-number: QTBUG-71290 Change-Id: Ibbd4baa84b66ab446ce3af2ef326f8c50e74216d Reviewed-by: Richard Moe Gustavsen --- tests/auto/qquickdrawer/tst_qquickdrawer.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/auto/qquickdrawer/tst_qquickdrawer.cpp') diff --git a/tests/auto/qquickdrawer/tst_qquickdrawer.cpp b/tests/auto/qquickdrawer/tst_qquickdrawer.cpp index e3a6ccf2..816f9b67 100644 --- a/tests/auto/qquickdrawer/tst_qquickdrawer.cpp +++ b/tests/auto/qquickdrawer/tst_qquickdrawer.cpp @@ -109,6 +109,8 @@ private slots: void slider_data(); void slider(); + void topEdgeScreenEdge(); + private: struct TouchDeviceDeleter { @@ -1316,6 +1318,20 @@ void tst_QQuickDrawer::slider() QTest::touchEvent(window, touchDevice.data()).release(0, to); } +void tst_QQuickDrawer::topEdgeScreenEdge() +{ + QQuickApplicationHelper helper(this, QStringLiteral("topEdgeScreenEdge.qml")); + QQuickWindow *window = helper.window; + window->show(); + QVERIFY(QTest::qWaitForWindowActive(window)); + + QQuickDrawer *drawer = window->property("drawer").value(); + QVERIFY(drawer); + + QVERIFY(QMetaObject::invokeMethod(drawer, "open")); + QTRY_COMPARE(drawer->position(), 1.0); +} + QTEST_QUICKCONTROLS_MAIN(tst_QQuickDrawer) #include "tst_qquickdrawer.moc" -- cgit v1.2.3