aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/handlers/qquickpointerhandler.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2016-08-08 17:09:15 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2016-08-23 20:49:05 +0000
commit8a06075f48ad352acfc70111682e7decf8fedb33 (patch)
tree1d241486b9eced82f0a7c15cd815fc6e10674dbf /src/quick/handlers/qquickpointerhandler.cpp
parenta0cb20c08db13003f7b8adc2f02fdcadf96fb8d1 (diff)
QQuickEventPoint::grabber: allow grabbing either an item or a handler
QQuickPointerHandler and QQuickItem have only QObject in common. Change-Id: I8fb68cc1779f42049db1e0eb5ff60019a1c674d3 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.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/quick/handlers/qquickpointerhandler.cpp b/src/quick/handlers/qquickpointerhandler.cpp
index 293eae914e..038e7f2571 100644
--- a/src/quick/handlers/qquickpointerhandler.cpp
+++ b/src/quick/handlers/qquickpointerhandler.cpp
@@ -64,11 +64,10 @@ QQuickPointerHandler::QQuickPointerHandler(QObject *parent)
void QQuickPointerHandler::setGrab(QQuickEventPoint *point, bool grab)
{
- // TODO eventually the handler itself should be the grabber, instead of the target Item
if (grab)
- point->setGrabber(m_target);
- else if (point->grabber() == m_target)
- point->setGrabber(nullptr);
+ point->setPointerHandlerGrabber(this);
+ else if (point->pointerHandlerGrabber() == this)
+ point->setPointerHandlerGrabber(nullptr);
}
QPointF QQuickPointerHandler::eventPos(const QQuickEventPoint *point) const