aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2018-06-14 13:54:07 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2018-06-20 22:01:20 +0000
commitbbeecc18ddfb8b076d15c36cb682ebf6e306a7df (patch)
treef74e3663d7ce9c0187f7f9d7e2ca1337b43f4c71 /src/quick
parentc7a5331a061d1062cbe37ab94122d4f76337cbe1 (diff)
Reduce warning frequency: missing point neither cancelled nor released
If wantsEventPoint() returns false, it means a handler has decided it doesn't want the point, not that the point is missing from the event. E.g. TapHandler rejects points which actually are being dragged, so this warning was making a lot of noise in the mixer.qml manual test. Change-Id: Ia8b8a2e41892ffe1b06ffafb51ef08c10234176c Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/handlers/qquicksinglepointhandler.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/quick/handlers/qquicksinglepointhandler.cpp b/src/quick/handlers/qquicksinglepointhandler.cpp
index 2147359df4..5ed41b96f2 100644
--- a/src/quick/handlers/qquicksinglepointhandler.cpp
+++ b/src/quick/handlers/qquicksinglepointhandler.cpp
@@ -79,16 +79,23 @@ bool QQuickSinglePointHandler::wantsPointerEvent(QQuickPointerEvent *event)
// It's expected to be an update or a release.
// If we no longer want it, cancel the grab.
int candidatePointCount = 0;
+ bool missing = true;
QQuickEventPoint *point = nullptr;
int c = event->pointCount();
for (int i = 0; i < c; ++i) {
QQuickEventPoint *p = event->point(i);
+ const bool found = (p->pointId() == m_pointInfo.m_id);
+ if (found)
+ missing = false;
if (wantsEventPoint(p)) {
++candidatePointCount;
- if (p->pointId() == m_pointInfo.m_id)
+ if (found)
point = p;
}
}
+ if (missing)
+ qCWarning(DBG_TOUCH_TARGET) << this << "pointId" << hex << m_pointInfo.m_id
+ << "is missing from current event, but was neither canceled nor released";
if (point) {
if (candidatePointCount == 1 || (candidatePointCount > 1 && m_ignoreAdditionalPoints)) {
point->setAccepted();
@@ -97,8 +104,6 @@ bool QQuickSinglePointHandler::wantsPointerEvent(QQuickPointerEvent *event)
point->cancelAllGrabs(this);
}
} else {
- qCWarning(DBG_TOUCH_TARGET) << this << "pointId" << hex << m_pointInfo.m_id
- << "is missing from current event, but was neither canceled nor released";
return false;
}
} else {