aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/quick/handlers/qquickpointhandler.cpp1
-rw-r--r--src/quick/handlers/qquicksinglepointhandler.cpp16
-rw-r--r--src/quick/handlers/qquicksinglepointhandler_p.h2
-rw-r--r--src/quick/handlers/qquicktaphandler.cpp2
-rw-r--r--src/quick/handlers/qquickwheelhandler.cpp2
5 files changed, 18 insertions, 5 deletions
diff --git a/src/quick/handlers/qquickpointhandler.cpp b/src/quick/handlers/qquickpointhandler.cpp
index c3dd997e4a..147724e5b3 100644
--- a/src/quick/handlers/qquickpointhandler.cpp
+++ b/src/quick/handlers/qquickpointhandler.cpp
@@ -156,6 +156,7 @@ void QQuickPointHandler::handleEventPoint(QPointerEvent *event, QEventPoint &poi
}
point.setAccepted(false); // Just lurking... don't interfere with propagation
emit translationChanged();
+ QQuickSinglePointHandler::handleEventPoint(event, point);
}
QVector2D QQuickPointHandler::translation() const
diff --git a/src/quick/handlers/qquicksinglepointhandler.cpp b/src/quick/handlers/qquicksinglepointhandler.cpp
index 6289177894..aa650654eb 100644
--- a/src/quick/handlers/qquicksinglepointhandler.cpp
+++ b/src/quick/handlers/qquicksinglepointhandler.cpp
@@ -136,13 +136,21 @@ void QQuickSinglePointHandler::handlePointerEventImpl(QPointerEvent *event)
Q_ASSERT(currentPoint);
d->pointInfo.reset(event, *currentPoint);
handleEventPoint(event, *currentPoint);
- if (currentPoint->state() == QEventPoint::Released && (static_cast<QSinglePointEvent *>(event)->buttons() & acceptedButtons()) == Qt::NoButton) {
- setExclusiveGrab(event, *currentPoint, false);
- d->reset();
- }
emit pointChanged();
}
+void QQuickSinglePointHandler::handleEventPoint(QPointerEvent *event, QEventPoint &point)
+{
+ if (point.state() != QEventPoint::Released)
+ return;
+
+ const Qt::MouseButtons releasedButtons = static_cast<QSinglePointEvent *>(event)->buttons();
+ if ((releasedButtons & acceptedButtons()) == Qt::NoButton) {
+ setExclusiveGrab(event, point, false);
+ d_func()->reset();
+ }
+}
+
void QQuickSinglePointHandler::onGrabChanged(QQuickPointerHandler *grabber, QPointingDevice::GrabTransition transition, QPointerEvent *event, QEventPoint &point)
{
Q_D(QQuickSinglePointHandler);
diff --git a/src/quick/handlers/qquicksinglepointhandler_p.h b/src/quick/handlers/qquicksinglepointhandler_p.h
index 85ab4f24d4..fd0351b3db 100644
--- a/src/quick/handlers/qquicksinglepointhandler_p.h
+++ b/src/quick/handlers/qquicksinglepointhandler_p.h
@@ -76,7 +76,7 @@ protected:
bool wantsPointerEvent(QPointerEvent *event) override;
void handlePointerEventImpl(QPointerEvent *event) override;
- virtual void handleEventPoint(QPointerEvent *event, QEventPoint &point) = 0;
+ virtual void handleEventPoint(QPointerEvent *event, QEventPoint &point);
QEventPoint &currentPoint(QPointerEvent *ev);
void onGrabChanged(QQuickPointerHandler *grabber, QPointingDevice::GrabTransition transition, QPointerEvent *event, QEventPoint &point) override;
diff --git a/src/quick/handlers/qquicktaphandler.cpp b/src/quick/handlers/qquicktaphandler.cpp
index e71738c2d2..0a7cc7e075 100644
--- a/src/quick/handlers/qquicktaphandler.cpp
+++ b/src/quick/handlers/qquicktaphandler.cpp
@@ -162,6 +162,8 @@ void QQuickTapHandler::handleEventPoint(QPointerEvent *event, QEventPoint &point
default:
break;
}
+
+ QQuickSinglePointHandler::handleEventPoint(event, point);
}
/*!
diff --git a/src/quick/handlers/qquickwheelhandler.cpp b/src/quick/handlers/qquickwheelhandler.cpp
index b598e43439..7045f10d8e 100644
--- a/src/quick/handlers/qquickwheelhandler.cpp
+++ b/src/quick/handlers/qquickwheelhandler.cpp
@@ -387,6 +387,8 @@ bool QQuickWheelHandler::wantsPointerEvent(QPointerEvent *event)
void QQuickWheelHandler::handleEventPoint(QPointerEvent *ev, QEventPoint &point)
{
Q_D(QQuickWheelHandler);
+ QQuickSinglePointHandler::handleEventPoint(ev, point);
+
if (ev->type() != QEvent::Wheel)
return;
const QWheelEvent *event = static_cast<const QWheelEvent *>(ev);