import QtQuick import QtTest Item { width: 300; height: 200 id: topLevelItem MultiPointTouchArea { anchors.fill: parent Column { width: parent.width height: parent.height Rectangle { width: parent.width height: 100 color: "green" } Rectangle { id: rect width: parent.width height: 600 color: "red" Text { id: consoleForPoors text: "Press H to test:\n" } MultiPointTouchArea { anchors.fill: parent onPressed: (touchPoints) => { for (let tp in touchPoints) { let touch = touchPoints[tp] consoleForPoors.text += "Pressed: x "+touch.x+" y "+touch.y+"\n" } } onReleased: (touchPoints) => { for (let tp in touchPoints) { let touch = touchPoints[tp] consoleForPoors.text += "Released: x "+touch.x+" y "+touch.y+"\n" } } } } } } TestCase { name: "ItemTests" id: test1 when: false function test_touch() { var touch = touchEvent(rect); touch.press(0, rect, 10, 10); touch.commit(); touch.release(0, rect, 10, 10); touch.commit(); wait(10000); } } focus: true Keys.onPressed: (event)=> { test1.when = true; } }