aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/handlers/qquickpointerhandler.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2016-08-05 08:28:15 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2016-08-16 09:32:54 +0000
commit199692e06c839c64dd888a0a85c403e5c247c40e (patch)
treefd4a3aa4e5b07bd6df36ad473730dc963b8eab22 /src/quick/handlers/qquickpointerhandler.cpp
parent54eab024611c6b9675ef6d48a15e7d69ed28df87 (diff)
QQuickPointerHandler: add eventPos() accessor
This is to compensate for the fact that the EventPoint does not store the Item-localized position, only scenePos. Either it should store it or we have to recalculate it in each Handler. Change-Id: I5b02814d5fd7930bb32b547c1af00808b8e23b80 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Diffstat (limited to 'src/quick/handlers/qquickpointerhandler.cpp')
-rw-r--r--src/quick/handlers/qquickpointerhandler.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/quick/handlers/qquickpointerhandler.cpp b/src/quick/handlers/qquickpointerhandler.cpp
index 9964d8f465..37238c4d51 100644
--- a/src/quick/handlers/qquickpointerhandler.cpp
+++ b/src/quick/handlers/qquickpointerhandler.cpp
@@ -71,6 +71,11 @@ void QQuickPointerHandler::setGrab(QQuickEventPoint *point, bool grab)
point->setGrabber(nullptr);
}
+QPointF QQuickPointerHandler::eventPos(const QQuickEventPoint *point) const
+{
+ return (m_target ? m_target->mapFromScene(point->scenePos()) : point->scenePos());
+}
+
/*!
\qmlproperty QQuickPointerHandler::enabled