aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/quick/handlers/qquickhandlerpoint.cpp4
-rw-r--r--src/quick/handlers/qquickhandlerpoint_p.h2
-rw-r--r--src/quick/handlers/qquicksinglepointhandler.cpp4
3 files changed, 5 insertions, 5 deletions
diff --git a/src/quick/handlers/qquickhandlerpoint.cpp b/src/quick/handlers/qquickhandlerpoint.cpp
index 2e4602affa..2990215719 100644
--- a/src/quick/handlers/qquickhandlerpoint.cpp
+++ b/src/quick/handlers/qquickhandlerpoint.cpp
@@ -82,7 +82,7 @@ void QQuickHandlerPoint::localize(QQuickItem *item)
void QQuickHandlerPoint::reset()
{
- m_id = 0;
+ m_id = -1;
m_device = QPointingDevice::primaryPointingDevice();
m_uniqueId = QPointingDeviceUniqueId();
m_position = QPointF();
@@ -167,7 +167,7 @@ void QQuickHandlerPoint::reset(const QVector<QQuickHandlerPoint> &points)
pressureSum += point.pressure();
ellipseDiameterSum += point.ellipseDiameters();
}
- m_id = 0;
+ m_id = -1;
m_device = nullptr;
m_uniqueId = QPointingDeviceUniqueId();
// all points are required to be from the same event, so pressed buttons and modifiers should be the same
diff --git a/src/quick/handlers/qquickhandlerpoint_p.h b/src/quick/handlers/qquickhandlerpoint_p.h
index 6ba5e3bf28..fd3b365e32 100644
--- a/src/quick/handlers/qquickhandlerpoint_p.h
+++ b/src/quick/handlers/qquickhandlerpoint_p.h
@@ -100,7 +100,7 @@ public:
void reset(const QVector<QQuickHandlerPoint> &points);
private:
- int m_id = 0;
+ int m_id = -1;
const QPointingDevice *m_device = QPointingDevice::primaryPointingDevice();
QPointingDeviceUniqueId m_uniqueId;
Qt::MouseButtons m_pressedButtons = Qt::NoButton;
diff --git a/src/quick/handlers/qquicksinglepointhandler.cpp b/src/quick/handlers/qquicksinglepointhandler.cpp
index b51f53b74f..89081b4e84 100644
--- a/src/quick/handlers/qquicksinglepointhandler.cpp
+++ b/src/quick/handlers/qquicksinglepointhandler.cpp
@@ -75,7 +75,7 @@ bool QQuickSinglePointHandler::wantsPointerEvent(QQuickPointerEvent *event)
if (!QQuickPointerDeviceHandler::wantsPointerEvent(event))
return false;
- if (d->pointInfo.id()) {
+ if (d->pointInfo.id() != -1) {
// We already know which one we want, so check whether it's there.
// It's expected to be an update or a release.
// If we no longer want it, cancel the grab.
@@ -125,7 +125,7 @@ bool QQuickSinglePointHandler::wantsPointerEvent(QQuickPointerEvent *event)
chosen->setAccepted();
}
}
- return d->pointInfo.id();
+ return d->pointInfo.id() != -1;
}
void QQuickSinglePointHandler::handlePointerEventImpl(QQuickPointerEvent *event)