summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2021-04-19 16:00:35 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-04-28 16:47:41 +0000
commitc69bee20735fccc039d4228e8a45ad9d20b4b135 (patch)
treeb2560e3447841c4eb0a66a6b1c2cc2dded744c41 /tests/auto
parent931e742a82019510b9d5b56758f272402b89ff41 (diff)
Add grabber context pointers
In Qt Quick we now need to keep track of which QQDeliveryAgent is responsible when a point is grabbed, either passively or exclusively. When we re-deliver to that grabber, we need to do it via the same agent, so that the same scene transform is used, and the grabber will see the event in the correct coordinate system. It's easier to track this mapping here instead of in a separate map in Qt Quick. Task-number: QTBUG-92944 Change-Id: I69f769c694d0da24885cdf4087e5032022bff629 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 40330b8f0a717098982d1f54f34a18a8262b1f55) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp2
-rw-r--r--tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp b/tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp
index d5174e0942..cdf11ec54a 100644
--- a/tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp
+++ b/tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp
@@ -290,7 +290,7 @@ void tst_QMouseEvent::grabbers()
QCOMPARE(firstEPD->exclusiveGrabber, grabExclusive ? testMouseWidget : nullptr);
QCOMPARE(firstEPD->passiveGrabbers.count(), grabPassive ? 1 : 0);
if (grabPassive)
- QCOMPARE(firstEPD->passiveGrabbers.first(), testMouseWidget);
+ QCOMPARE(firstEPD->passiveGrabbers.keys().first(), testMouseWidget);
// Ensure that grabbers are forgotten after release delivery
QTest::mouseRelease(testMouseWidget, Qt::LeftButton, Qt::KeyboardModifiers(), {10, 10});
diff --git a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
index 28c33e8226..fa3f495c23 100644
--- a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
+++ b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
@@ -1949,7 +1949,7 @@ void tst_QTouchEvent::grabbers()
QCOMPARE(devPriv->pointById(0)->exclusiveGrabber, grabExclusive ? &w : nullptr);
QCOMPARE(devPriv->pointById(0)->passiveGrabbers.count(), grabPassive ? 1 : 0);
if (grabPassive)
- QCOMPARE(devPriv->pointById(0)->passiveGrabbers.first(), &w);
+ QCOMPARE(devPriv->pointById(0)->passiveGrabbers.keys().first(), &w);
// Ensure that eventpoints are forgotten after release delivery
points.first().state = QEventPoint::State::Released;