aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickmultipointtoucharea.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/items/qquickmultipointtoucharea.cpp')
-rw-r--r--src/quick/items/qquickmultipointtoucharea.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/quick/items/qquickmultipointtoucharea.cpp b/src/quick/items/qquickmultipointtoucharea.cpp
index e6b63d32f2..9e658cc668 100644
--- a/src/quick/items/qquickmultipointtoucharea.cpp
+++ b/src/quick/items/qquickmultipointtoucharea.cpp
@@ -451,6 +451,12 @@ void QQuickMultiPointTouchArea::touchEvent(QTouchEvent *event)
}
break;
}
+ case QEvent::TouchCancel:
+ _stealMouse = false;
+ setKeepMouseGrab(false);
+ setKeepTouchGrab(false);
+ ungrabTouchPoints();
+ break;
default:
QQuickItem::touchEvent(event);
break;
@@ -496,8 +502,9 @@ void QQuickMultiPointTouchArea::updateTouchData(QEvent *event)
else if (event->type() == QEvent::MouseButtonRelease)
_mouseQpaTouchPoint.setState(Qt::TouchPointReleased);
else { // QEvent::MouseButtonPress
+ addTouchPoint(me);
+ started = true;
_mouseQpaTouchPoint.setState(Qt::TouchPointPressed);
- _pressedTouchPoints.append(_mouseTouchPoint);
}
touchPoints << _mouseQpaTouchPoint;
isMouseEvent = true;
@@ -723,9 +730,7 @@ void QQuickMultiPointTouchArea::mousePressEvent(QMouseEvent *event)
return;
if (_touchPoints.count() >= _minimumTouchPoints - 1 && _touchPoints.count() < _maximumTouchPoints) {
- addTouchPoint(event);
updateTouchData(event);
- emit pressed(_pressedTouchPoints);
}
}
@@ -756,10 +761,7 @@ void QQuickMultiPointTouchArea::mouseReleaseEvent(QMouseEvent *event)
if (_mouseTouchPoint) {
updateTouchData(event);
- _mouseTouchPoint->setPressed(false);
_mouseTouchPoint->setInUse(false);
- _releasedTouchPoints.append(_mouseTouchPoint);
- emit released(_releasedTouchPoints);
_releasedTouchPoints.removeAll(_mouseTouchPoint);
_mouseTouchPoint = Q_NULLPTR;
}