aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/pointerhandlers/qquickpointerhandler/tst_qquickpointerhandler.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2021-05-25 20:39:41 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2021-05-26 14:46:39 +0200
commit348085dd7d1aeb83628eeb9687d70b0ba595dacd (patch)
tree12f7b8039edf329f829f92ecb6d7735363fe2c92 /tests/auto/quick/pointerhandlers/qquickpointerhandler/tst_qquickpointerhandler.cpp
parent0472a7a4326cf9ac1abdcbc0910c3b13f5c4fb5a (diff)
Add dynamically-created pointer handlers to parent's resources
Fixes: QTBUG-94005 Change-Id: I609620627682e3e95c284adf897b08007e3e0726 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/quick/pointerhandlers/qquickpointerhandler/tst_qquickpointerhandler.cpp')
-rw-r--r--tests/auto/quick/pointerhandlers/qquickpointerhandler/tst_qquickpointerhandler.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/quick/pointerhandlers/qquickpointerhandler/tst_qquickpointerhandler.cpp b/tests/auto/quick/pointerhandlers/qquickpointerhandler/tst_qquickpointerhandler.cpp
index 8b83972967..2d8c722649 100644
--- a/tests/auto/quick/pointerhandlers/qquickpointerhandler/tst_qquickpointerhandler.cpp
+++ b/tests/auto/quick/pointerhandlers/qquickpointerhandler/tst_qquickpointerhandler.cpp
@@ -485,6 +485,12 @@ void tst_PointerHandlers::mouseEventDelivery()
EventItem *eventItem1 = window->rootObject()->findChild<EventItem*>("eventItem1");
QVERIFY(eventItem1);
+ EventHandler *handler = window->rootObject()->findChild<EventHandler*>("eventHandler");
+ QVERIFY(handler);
+ QCOMPARE(handler->parentItem(), eventItem1);
+ QCOMPARE(handler->target(), eventItem1);
+ QVERIFY(QQuickItemPrivate::get(eventItem1)->extra->resourcesList.contains(handler));
+
// Do not accept anything
QPoint p1 = QPoint(20, 20);
QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, p1);
@@ -631,6 +637,7 @@ void tst_PointerHandlers::dynamicCreation()
QCOMPARE(handler->parentItem(), eventItem1);
QCOMPARE(handler->target(), eventItem1);
+ QVERIFY(QQuickItemPrivate::get(eventItem1)->extra->resourcesList.contains(handler));
QPoint p1(20, 20);
QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, p1);