aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/handlers
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2021-05-20 17:08:44 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-05-27 10:00:32 +0000
commit1b56c6ebb3fa66ebf0f7366bd9ba5a50089f4d95 (patch)
tree0002fbd408bac7b33dbaff4ef6c3495523a8ef7b /src/quick/handlers
parent23afb7d618373452b8232825c569abb8c235c379 (diff)
Emit grabChanged() from DragHandler and PinchHandler
Followup to ca7cdd71ee33f0d77eb6bf1367d2532e26155cb2 : when overriding a virtual function, it's good practice to call the base class function, in the absence of any reason not to. Fixes: QTBUG-93880 Change-Id: Icbd04faec51d55d8fbf73319bd20f5846761d3d5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit a10eeee97d42f05409074f69cc99d9a8da5db077) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/quick/handlers')
-rw-r--r--src/quick/handlers/qquickmultipointhandler.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/quick/handlers/qquickmultipointhandler.cpp b/src/quick/handlers/qquickmultipointhandler.cpp
index 97cb958aa6..6f66d0e426 100644
--- a/src/quick/handlers/qquickmultipointhandler.cpp
+++ b/src/quick/handlers/qquickmultipointhandler.cpp
@@ -145,7 +145,7 @@ void QQuickMultiPointHandler::onActiveChanged()
}
}
-void QQuickMultiPointHandler::onGrabChanged(QQuickPointerHandler *, QPointingDevice::GrabTransition transition, QPointerEvent *, QEventPoint &)
+void QQuickMultiPointHandler::onGrabChanged(QQuickPointerHandler *grabber, QPointingDevice::GrabTransition transition, QPointerEvent *event, QEventPoint &point)
{
Q_D(QQuickMultiPointHandler);
// If another handler or item takes over this set of points, assume it has
@@ -154,6 +154,20 @@ void QQuickMultiPointHandler::onGrabChanged(QQuickPointerHandler *, QPointingDev
// (e.g. between DragHandler and PinchHandler).
if (transition == QPointingDevice::UngrabExclusive || transition == QPointingDevice::CancelGrabExclusive)
d->currentPoints.clear();
+ if (grabber != this)
+ return;
+ switch (transition) {
+ case QPointingDevice::GrabExclusive:
+ case QPointingDevice::GrabPassive:
+ case QPointingDevice::UngrabPassive:
+ case QPointingDevice::UngrabExclusive:
+ case QPointingDevice::CancelGrabPassive:
+ case QPointingDevice::CancelGrabExclusive:
+ QQuickPointerHandler::onGrabChanged(grabber, transition, event, point);
+ break;
+ case QPointingDevice::OverrideGrabPassive:
+ return; // don't emit
+ }
}
QVector<QEventPoint> QQuickMultiPointHandler::eligiblePoints(QPointerEvent *event)