aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2016-12-05 12:08:02 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2017-02-10 20:24:48 +0000
commitf3cf71bae2e4bdc83ffa661d7273f6709b006615 (patch)
treeba6571c497cb981f979426d01081af2cd3f722ea
parent146c0bd566a0a1d4bd92619eefeae272d45a44bc (diff)
notify all passive-grabbing PointerHandlers when exclusive grab changes
Change-Id: I45df7abdbd91e068a69101ed27e2ec44272e3899 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
-rw-r--r--src/quick/handlers/qquickpointerhandler.cpp7
-rw-r--r--src/quick/handlers/qquickpointerhandler_p.h1
-rw-r--r--src/quick/items/qquickevents.cpp3
3 files changed, 10 insertions, 1 deletions
diff --git a/src/quick/handlers/qquickpointerhandler.cpp b/src/quick/handlers/qquickpointerhandler.cpp
index c91fb2de88..641324e61e 100644
--- a/src/quick/handlers/qquickpointerhandler.cpp
+++ b/src/quick/handlers/qquickpointerhandler.cpp
@@ -176,6 +176,13 @@ void QQuickPointerHandler::handleGrabCancel(QQuickEventPoint *point)
emit canceled(point);
}
+void QQuickPointerHandler::handleGrab(QQuickEventPoint *point, QQuickPointerHandler *grabber, bool grab)
+{
+ Q_UNUSED(point);
+ Q_UNUSED(grabber);
+ Q_UNUSED(grab);
+}
+
bool QQuickPointerHandler::wantsPointerEvent(QQuickPointerEvent *event)
{
Q_UNUSED(event)
diff --git a/src/quick/handlers/qquickpointerhandler_p.h b/src/quick/handlers/qquickpointerhandler_p.h
index 526a60262b..0931cfcfad 100644
--- a/src/quick/handlers/qquickpointerhandler_p.h
+++ b/src/quick/handlers/qquickpointerhandler_p.h
@@ -103,6 +103,7 @@ protected:
void setExclusiveGrab(QQuickEventPoint *point, bool grab = true);
void cancelAllGrabs(QQuickEventPoint *point);
virtual void handleGrabCancel(QQuickEventPoint *point);
+ virtual void handleGrab(QQuickEventPoint *point, QQuickPointerHandler *grabber, bool grab);
QPointF eventPos(const QQuickEventPoint *point) const;
bool parentContains(const QQuickEventPoint *point) const;
diff --git a/src/quick/items/qquickevents.cpp b/src/quick/items/qquickevents.cpp
index bd4e48fb05..c3f6964ba6 100644
--- a/src/quick/items/qquickevents.cpp
+++ b/src/quick/items/qquickevents.cpp
@@ -619,7 +619,8 @@ void QQuickEventPoint::setGrabberPointerHandler(QQuickPointerHandler *grabber, b
m_exclusiveGrabber = QPointer<QObject>(grabber);
m_grabberIsHandler = true;
m_sceneGrabPos = m_scenePos;
- m_passiveGrabbers.removeAll(QPointer<QQuickPointerHandler>(grabber));
+ for (QPointer<QQuickPointerHandler> passiveGrabber : m_passiveGrabbers)
+ passiveGrabber->handleGrab(this, grabber, true);
}
} else {
if (!grabber) {