diff options
author | Oliver Eftevaag <[email protected]> | 2025-10-17 06:29:55 +0200 |
---|---|---|
committer | Oliver Eftevaag <[email protected]> | 2025-10-20 12:05:23 +0200 |
commit | 89f08f960993bf4b55ed9f72ac7278bb1a772001 (patch) | |
tree | 84af5f4f3184174d0c38e85ea6a58855a8458a9a | |
parent | 1530e5c9f01f94e15685819f5f588185ee001ea6 (diff) |
The touch event's scene position is normally set in the delivery agent.
However, since the overlay installs an event filter on the window
itself, it will circumvent the delivery agent and thus never set the
scene position properly.
This patch ensures that the scene position gets set when we're entering
overlayEvent from the event filter, for touch release events.
Task-number: QTBUG-132914
Pick-to: 6.10 6.8
Change-Id: Id59ed9e5252ba594ce0e40039cb3a783032caef1
Reviewed-by: Mitch Curtis <[email protected]>
Reviewed-by: Shawn Rutledge <[email protected]>
-rw-r--r-- | src/quick/util/qquickdeliveryagent_p_p.h | 2 | ||||
-rw-r--r-- | src/quicktemplates/qquickoverlay.cpp | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/quick/util/qquickdeliveryagent_p_p.h b/src/quick/util/qquickdeliveryagent_p_p.h index b7c86812d0..3874994b4e 100644 --- a/src/quick/util/qquickdeliveryagent_p_p.h +++ b/src/quick/util/qquickdeliveryagent_p_p.h @@ -128,7 +128,7 @@ public: // Mouse positions are saved in widget coordinates QPointF lastMousePosition; bool deliverTouchAsMouse(QQuickItem *item, QTouchEvent *pointerEvent); - void translateTouchEvent(QTouchEvent *touchEvent); + static void translateTouchEvent(QTouchEvent *touchEvent); void removeGrabber(QQuickItem *grabber, bool mouse = true, bool touch = true, bool cancel = false); void clearGrabbers(QPointerEvent *pointerEvent); void onGrabChanged(QObject *grabber, QPointingDevice::GrabTransition transition, const QPointerEvent *event, const QEventPoint &point); diff --git a/src/quicktemplates/qquickoverlay.cpp b/src/quicktemplates/qquickoverlay.cpp index be1ee33833..0f564c8209 100644 --- a/src/quicktemplates/qquickoverlay.cpp +++ b/src/quicktemplates/qquickoverlay.cpp @@ -529,8 +529,10 @@ bool QQuickOverlay::eventFilter(QObject *object, QEvent *event) // allow non-modal popups to close on touch release outside if (!d->mouseGrabberPopup) { - for (const QTouchEvent::TouchPoint &point : static_cast<QTouchEvent *>(event)->points()) { + QTouchEvent *touchEvent = static_cast<QTouchEvent *>(event); + for (const QTouchEvent::TouchPoint &point : touchEvent->points()) { if (point.state() == QEventPoint::Released) { + QQuickDeliveryAgentPrivate::translateTouchEvent(touchEvent); if (d->handleRelease(d->window->contentItem(), event, nullptr)) break; } |