aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/items')
-rw-r--r--src/quick/items/qquickpathview.cpp2
-rw-r--r--src/quick/items/qquickwindow.cpp21
2 files changed, 14 insertions, 9 deletions
diff --git a/src/quick/items/qquickpathview.cpp b/src/quick/items/qquickpathview.cpp
index 879db6284e..e7e19b041e 100644
--- a/src/quick/items/qquickpathview.cpp
+++ b/src/quick/items/qquickpathview.cpp
@@ -1632,6 +1632,7 @@ void QQuickPathView::mousePressEvent(QMouseEvent *event)
void QQuickPathViewPrivate::handleMousePressEvent(QMouseEvent *event)
{
+ Q_Q(QQuickPathView);
if (!interactive || !items.count() || !model || !modelCount)
return;
velocityBuffer.clear();
@@ -1657,6 +1658,7 @@ void QQuickPathViewPrivate::handleMousePressEvent(QMouseEvent *event)
stealMouse = true; // If we've been flicked then steal the click.
else
stealMouse = false;
+ q->setKeepMouseGrab(stealMouse);
timer.start();
lastPosTime = computeCurrentTime(event);
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 804d82a212..8caa568a6c 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -697,8 +697,8 @@ bool QQuickWindowPrivate::deliverTouchAsMouse(QQuickItem *item, QQuickPointerEve
touchMouseId = p.id();
if (!q->mouseGrabberItem())
item->grabMouse();
- auto pointerEventPoint = pointerEvent->pointById(p.id());
- pointerEventPoint->setGrabberItem(item);
+ if (auto pointerEventPoint = pointerEvent->pointById(p.id()))
+ pointerEventPoint->setGrabberItem(item);
if (checkIfDoubleClicked(event->timestamp())) {
QScopedPointer<QMouseEvent> mouseDoubleClick(touchToMouseEvent(QEvent::MouseButtonDblClick, p, event.data(), item, false));
@@ -2637,19 +2637,22 @@ void QQuickWindowPrivate::deliverMatchingPointsToItem(QQuickItem *item, QQuickPo
// update accepted new points.
bool isPressOrRelease = pointerEvent->isPressEvent() || pointerEvent->isReleaseEvent();
for (auto point: qAsConst(touchEvent->touchPoints())) {
- auto pointerEventPoint = ptEvent->pointById(point.id());
- pointerEventPoint->setAccepted();
- if (isPressOrRelease)
- pointerEventPoint->setGrabberItem(item);
+ if (auto pointerEventPoint = ptEvent->pointById(point.id())) {
+ pointerEventPoint->setAccepted();
+ if (isPressOrRelease)
+ pointerEventPoint->setGrabberItem(item);
+ }
}
} else {
// But if the event was not accepted then we know this item
// will not be interested in further updates for those touchpoint IDs either.
for (auto point: qAsConst(touchEvent->touchPoints())) {
if (point.state() == Qt::TouchPointPressed) {
- if (ptEvent->pointById(point.id())->exclusiveGrabber() == item) {
- qCDebug(DBG_TOUCH_TARGET) << "TP" << hex << point.id() << "disassociated";
- ptEvent->pointById(point.id())->setGrabberItem(nullptr);
+ if (auto *tp = ptEvent->pointById(point.id())) {
+ if (tp->exclusiveGrabber() == item) {
+ qCDebug(DBG_TOUCH_TARGET) << "TP" << hex << point.id() << "disassociated";
+ tp->setGrabberItem(nullptr);
+ }
}
}
}