diff options
Diffstat (limited to 'tests/auto/quick/pointerhandlers/multipointtoucharea_interop/tst_multipointtoucharea_interop.cpp')
-rw-r--r-- | tests/auto/quick/pointerhandlers/multipointtoucharea_interop/tst_multipointtoucharea_interop.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/quick/pointerhandlers/multipointtoucharea_interop/tst_multipointtoucharea_interop.cpp b/tests/auto/quick/pointerhandlers/multipointtoucharea_interop/tst_multipointtoucharea_interop.cpp index b994e0fc07..bf582b820b 100644 --- a/tests/auto/quick/pointerhandlers/multipointtoucharea_interop/tst_multipointtoucharea_interop.cpp +++ b/tests/auto/quick/pointerhandlers/multipointtoucharea_interop/tst_multipointtoucharea_interop.cpp @@ -55,6 +55,7 @@ private slots: void touchDrag(); void touchesThenPinch(); + void unloadHandlerWithPassiveGrab(); private: void createView(QScopedPointer<QQuickView> &window, const char *fileName); @@ -282,6 +283,24 @@ void tst_MptaInterop::touchesThenPinch() QTRY_COMPARE(mptaReleasedSpy.count(), 1); } +void tst_MptaInterop::unloadHandlerWithPassiveGrab() +{ + QScopedPointer<QQuickView> windowPtr; + createView(windowPtr, "unloadHandlerOnPress.qml"); + QQuickView * window = windowPtr.data(); + + QPointer<QQuickPointerHandler> handler = window->rootObject()->findChild<QQuickPointerHandler*>(); + QVERIFY(handler); + QQuickMultiPointTouchArea *mpta = window->rootObject()->findChild<QQuickMultiPointTouchArea*>(); + QVERIFY(mpta); + + QPoint point(90, 90); + QTest::mousePress(window, Qt::LeftButton, 0, point); + QCOMPARE(window->mouseGrabberItem(), mpta); + QTRY_VERIFY(handler.isNull()); // it got unloaded + QTest::mouseRelease(window, Qt::LeftButton, 0, point); // QTBUG-73819: don't crash +} + QTEST_MAIN(tst_MptaInterop) #include "tst_multipointtoucharea_interop.moc" |