aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/handlers/qquickhandlerpoint.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2018-02-16 08:43:08 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2018-07-27 10:43:04 +0000
commitf2ba3bd9792500b4d3fcfd23b03098a32641ef4f (patch)
tree5fdae298618ae42ae6e2d456bb719168377274db /src/quick/handlers/qquickhandlerpoint.cpp
parent0e1f83dcade8cb6428513eea4452dcd500f9e486 (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/qquickhandlerpoint.cpp')
-rw-r--r--src/quick/handlers/qquickhandlerpoint.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/quick/handlers/qquickhandlerpoint.cpp b/src/quick/handlers/qquickhandlerpoint.cpp
index f615829d97..00347245ee 100644
--- a/src/quick/handlers/qquickhandlerpoint.cpp
+++ b/src/quick/handlers/qquickhandlerpoint.cpp
@@ -103,16 +103,20 @@ void QQuickHandlerPoint::reset(const QQuickEventPoint *point)
switch (point->state()) {
case QQuickEventPoint::Pressed:
m_pressPosition = point->position();
+ m_scenePressPosition = point->scenePosition();
m_pressedButtons = event->buttons();
break;
case QQuickEventPoint::Released:
- reset();
- return;
+ if (event->buttons() == Qt::NoButton) {
+ reset();
+ return;
+ }
+ break;
default:
- m_pressedButtons = event->buttons();
break;
}
m_scenePressPosition = point->scenePressPosition();
+ m_pressedButtons = event->buttons();
m_pressedModifiers = event->modifiers();
if (event->asPointerTouchEvent()) {
const QQuickEventTouchPoint *tp = static_cast<const QQuickEventTouchPoint *>(point);