diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-02-16 08:43:08 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-07-27 10:43:04 +0000 |
commit | f2ba3bd9792500b4d3fcfd23b03098a32641ef4f (patch) | |
tree | 5fdae298618ae42ae6e2d456bb719168377274db /src/quick/handlers/qquickpointhandler.cpp | |
parent | 0e1f83dcade8cb6428513eea4452dcd500f9e486 (diff) |
PointHandler: stay active as long as acceptedButtons satisfied
Ignore buttons which do not fit the acceptedButtons filter, and
do not assume that it's all over when any release happens.
Task-number: QTBUG-66360
Change-Id: I871ea7fdd9b76f06fa0d73382617b287c04d35ab
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/handlers/qquickpointhandler.cpp')
-rw-r--r-- | src/quick/handlers/qquickpointhandler.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/quick/handlers/qquickpointhandler.cpp b/src/quick/handlers/qquickpointhandler.cpp index da19584b7a..854fadf5cf 100644 --- a/src/quick/handlers/qquickpointhandler.cpp +++ b/src/quick/handlers/qquickpointhandler.cpp @@ -139,11 +139,14 @@ void QQuickPointHandler::handleEventPoint(QQuickEventPoint *point) { switch (point->state()) { case QQuickEventPoint::Pressed: - setPassiveGrab(point); - setActive(true); + if ((point->pointerEvent()->buttons() & acceptedButtons()) != Qt::NoButton) { + setPassiveGrab(point); + setActive(true); + } break; case QQuickEventPoint::Released: - setActive(false); + if ((point->pointerEvent()->buttons() & acceptedButtons()) == Qt::NoButton) + setActive(false); break; default: break; |