aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/touchmouse
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@qt.io>2017-05-08 11:25:10 +0200
committerJani Heikkinen <jani.heikkinen@qt.io>2017-05-10 11:31:56 +0000
commite0c30279ec1fad88346ed3fb483bc3c672fdd01b (patch)
treeb4100688b65b66c83249a11f212ebff8c4a56409 /tests/auto/quick/touchmouse
parent802a5be531a9f2b1396f4ea4715c9a1dc593f778 (diff)
Move pointerEvent instance to QQuickWindow
With two or more windows, if events are being delivered to each, the grabbers can be different in each. We need unique instances of the QQuickPointerEvent objects for each window to avoid losing the grab state in the parent window while delivering a synthesized event to a subwindow, for example. Change-Id: I51da1212d573853969e32ad78f5b219d979a8a5c Task-number: QTBUG-57253 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/auto/quick/touchmouse')
-rw-r--r--tests/auto/quick/touchmouse/tst_touchmouse.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/quick/touchmouse/tst_touchmouse.cpp b/tests/auto/quick/touchmouse/tst_touchmouse.cpp
index fbdeb1d836..c4a222e970 100644
--- a/tests/auto/quick/touchmouse/tst_touchmouse.cpp
+++ b/tests/auto/quick/touchmouse/tst_touchmouse.cpp
@@ -571,7 +571,7 @@ void tst_TouchMouse::buttonOnFlickable()
QQuickWindowPrivate *windowPriv = QQuickWindowPrivate::get(window.data());
QVERIFY(windowPriv->touchMouseId != -1);
- auto pointerEvent = QQuickPointerDevice::touchDevices().at(0)->pointerEvent();
+ auto pointerEvent = windowPriv->pointerEventInstance(QQuickPointerDevice::touchDevices().at(0));
QCOMPARE(pointerEvent->point(0)->grabber(), eventItem1);
QCOMPARE(window->mouseGrabberItem(), eventItem1);
@@ -632,7 +632,7 @@ void tst_TouchMouse::touchButtonOnFlickable()
QQuickWindowPrivate *windowPriv = QQuickWindowPrivate::get(window.data());
QVERIFY(windowPriv->touchMouseId == -1);
- auto pointerEvent = QQuickPointerDevice::touchDevices().at(0)->pointerEvent();
+ auto pointerEvent = windowPriv->pointerEventInstance(QQuickPointerDevice::touchDevices().at(0));
QCOMPARE(pointerEvent->point(0)->grabber(), eventItem2);
QCOMPARE(window->mouseGrabberItem(), nullptr);
@@ -758,7 +758,7 @@ void tst_TouchMouse::buttonOnDelayedPressFlickable()
// for the touchMouseId to the new grabber.
QCOMPARE(window->mouseGrabberItem(), flickable);
QVERIFY(windowPriv->touchMouseId != -1);
- auto pointerEvent = QQuickPointerDevice::touchDevices().at(0)->pointerEvent();
+ auto pointerEvent = windowPriv->pointerEventInstance(QQuickPointerDevice::touchDevices().at(0));
QCOMPARE(pointerEvent->point(0)->grabber(), flickable);
QTest::touchEvent(window.data(), device).release(0, p3, window.data());