aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util/qquickdeliveryagent.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2021-07-02 21:27:54 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2021-07-05 15:09:50 +0200
commit0a271b5cd4da9e13accbf63a576413c45f367adc (patch)
tree1d9961c85e3be58305a77693832a18139be3fc79 /src/quick/util/qquickdeliveryagent.cpp
parentcd8e839e032f31a7421f33fd65dc3eaba4d84052 (diff)
Send hover events with correct scene and global positions
Task-number: QTBUG-94971 Pick-to: 6.1 6.2 Change-Id: I047223dfdb76a6f1237b9d15b54381cd085aa1ac Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/quick/util/qquickdeliveryagent.cpp')
-rw-r--r--src/quick/util/qquickdeliveryagent.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/quick/util/qquickdeliveryagent.cpp b/src/quick/util/qquickdeliveryagent.cpp
index ea6d5a9e77..344024ab7c 100644
--- a/src/quick/util/qquickdeliveryagent.cpp
+++ b/src/quick/util/qquickdeliveryagent.cpp
@@ -930,12 +930,16 @@ bool QQuickDeliveryAgentPrivate::sendHoverEvent(QEvent::Type type, QQuickItem *i
const QPointF &scenePos, const QPointF &lastScenePos,
Qt::KeyboardModifiers modifiers, ulong timestamp)
{
- const QTransform transform = QQuickItemPrivate::get(item)->windowToItemTransform();
-
- //create copy of event
+ auto itemPrivate = QQuickItemPrivate::get(item);
+ const QTransform transform = itemPrivate->windowToItemTransform();
QHoverEvent hoverEvent(type, transform.map(scenePos), transform.map(lastScenePos), modifiers);
hoverEvent.setTimestamp(timestamp);
hoverEvent.setAccepted(true);
+ const QTransform transformToGlobal = itemPrivate->windowToGlobalTransform();
+ QMutableEventPoint &point = QMutableEventPoint::from(hoverEvent.point(0));
+ point.setScenePosition(scenePos);
+ point.setGlobalPosition(transformToGlobal.map(scenePos));
+ point.setGlobalLastPosition(transformToGlobal.map(lastScenePos));
hasFiltered.clear();
if (sendFilteredMouseEvent(&hoverEvent, item, item->parentItem()))