\qmlsignal QtQuick2::MultiPointTouchArea::touchUpdated(list<TouchPoint> touchPoints)
This handler is called when the touch points handled by the MultiPointTouchArea change. This includes adding new touch points,
- removing previous touch points, as well as updating current touch point data. \a touchPoints is the list of all current touch
+ removing or canceling previous touch points, as well as updating current touch point data. \a touchPoints is the list of all current touch
points.
*/
if (ended) emit touchPointsReleased(_releasedTouchPoints);
if (moved) emit touchPointsUpdated(_movedTouchPoints);
if (started) emit touchPointsPressed(_pressedTouchPoints);
- if (!_touchPoints.isEmpty()) emit touchUpdated(_touchPoints.values());
+ if (ended || moved || started) emit touchUpdated(_touchPoints.values());
}
}
dtp->setInUse(false);
}
_touchPoints.clear();
+ emit touchUpdated(QList<QObject*>());
}
}
contentWidth: width
contentHeight: height * 2
+ property int cancelCount: 0
+ property int touchCount: 0
+
MultiPointTouchArea {
anchors.fill: parent
minimumTouchPoints: 2
TouchPoint { id: point1; objectName: "point1" },
TouchPoint { id: point2; objectName: "point2" }
]
+
+ onTouchPointsCanceled: cancelCount = touchPoints.length
+ onTouchUpdated: touchCount = touchPoints.length
}
}
touchPointUpdateCount = 0;
touchPointReleaseCount = 0;
touchCount = 0;
+ touchUpdatedHandled = false;
}
property int touchPointPressCount: 0
property int touchPointUpdateCount: 0
property int touchPointReleaseCount: 0
property int touchCount: 0
+ property bool touchUpdatedHandled: false
maximumTouchPoints: 5
onTouchPointsPressed: { touchPointPressCount = touchPoints.length }
onTouchPointsUpdated: { touchPointUpdateCount = touchPoints.length }
onTouchPointsReleased: { touchPointReleaseCount = touchPoints.length }
- onTouchUpdated: { touchCount = touchPoints.length }
+ onTouchUpdated: {
+ touchCount = touchPoints.length
+ touchUpdatedHandled = true
+ }
}
QCOMPARE(area->property("touchPointUpdateCount").toInt(), 0);
QCOMPARE(area->property("touchPointReleaseCount").toInt(), 3);
QCOMPARE(area->property("touchCount").toInt(), 0);
+ QCOMPARE(area->property("touchUpdatedHandled").toBool(), true);
QMetaObject::invokeMethod(area, "clearCounts");
delete canvas;
QCOMPARE(point11->pressed(), true);
QCOMPARE(point12->pressed(), true);
+ QCOMPARE(flickable->property("cancelCount").toInt(), 0);
+ QCOMPARE(flickable->property("touchCount").toInt(), 2);
p1 += QPoint(0,15); p2 += QPoint(0,15);
QTest::touchEvent(canvas, device).move(0, p1).move(1, p2);
QVERIFY(flickable->contentY() < 0);
QCOMPARE(point11->pressed(), false);
QCOMPARE(point12->pressed(), false);
+ QCOMPARE(flickable->property("cancelCount").toInt(), 2);
+ QCOMPARE(flickable->property("touchCount").toInt(), 0);
QTest::touchEvent(canvas, device).release(0, p1).release(1, p2);
QTest::mouseRelease(canvas,Qt::LeftButton, 0, p1);