summaryrefslogtreecommitdiffstats
path: root/src/quick/handlers/qquicksinglepointhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/handlers/qquicksinglepointhandler.cpp')
-rw-r--r--src/quick/handlers/qquicksinglepointhandler.cpp16
1 files changed, 12 insertions, 4 deletions
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);