Avoid copying touchpoints, and only check until we find a match.

Change-Id: I46fad782e93fe1f940acec05f4e1bb4afb5be230
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
This commit is contained in:
Robin Burchell 2013-09-17 15:20:22 +02:00 committed by The Qt Project
parent a6bdcc1bd1
commit 74d213726d
1 changed files with 7 additions and 2 deletions

View File

@ -1710,9 +1710,14 @@ bool QQuickWindowPrivate::deliverTouchPoints(QQuickItem *item, QTouchEvent *even
// a single stationary press on an item shouldn't cause an event
if (matchingNewPoints.isEmpty()) {
bool stationaryOnly = true;
Q_FOREACH (QTouchEvent::TouchPoint tp, matchingPoints)
if (tp.state() != Qt::TouchPointStationary)
foreach (const QTouchEvent::TouchPoint &tp, matchingPoints) {
if (tp.state() != Qt::TouchPointStationary) {
stationaryOnly = false;
break;
}
}
if (stationaryOnly)
matchingPoints.clear();
}