aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/handlers/qquickpointhandler.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2018-08-21 22:22:13 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2018-08-22 11:51:36 +0000
commit0eb65826c85aee9431c1a1f4ef3289abac2ae27d (patch)
tree63b660ff671671e7ffa9bf44d43b8ead0678fddd /src/quick/handlers/qquickpointhandler.cpp
parentd83cb16d3cecad7ec2e9b45416620b87b52f2885 (diff)
Ensure that SinglePointHandler handles touch points
A QQuickPointerTouchEvent's button and buttons properties are not currently set (although we had some uncertainty in the past about whether it would be appropriate for a touch press to simulate a left button press). So it seems that f2ba3bd9792500b4d3fcfd23b03098a32641ef4f broke the behavior of PointHandler on touchscreens. Change-Id: I890cc9889e847636c8f385753e47a078ec582195 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.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/quick/handlers/qquickpointhandler.cpp b/src/quick/handlers/qquickpointhandler.cpp
index 854fadf5cf..3bc1c06a1a 100644
--- a/src/quick/handlers/qquickpointhandler.cpp
+++ b/src/quick/handlers/qquickpointhandler.cpp
@@ -139,13 +139,15 @@ void QQuickPointHandler::handleEventPoint(QQuickEventPoint *point)
{
switch (point->state()) {
case QQuickEventPoint::Pressed:
- if ((point->pointerEvent()->buttons() & acceptedButtons()) != Qt::NoButton) {
+ if (point->pointerEvent()->asPointerTouchEvent() ||
+ (point->pointerEvent()->buttons() & acceptedButtons()) != Qt::NoButton) {
setPassiveGrab(point);
setActive(true);
}
break;
case QQuickEventPoint::Released:
- if ((point->pointerEvent()->buttons() & acceptedButtons()) == Qt::NoButton)
+ if (point->pointerEvent()->asPointerTouchEvent() ||
+ (point->pointerEvent()->buttons() & acceptedButtons()) == Qt::NoButton)
setActive(false);
break;
default: