From 95d1ff465c292445d36fa071b1f37a8cdaa2d7aa Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 18 Oct 2016 18:45:49 +0200 Subject: TapHandler manual test: demonstrate tapped signal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Missiles are too expensive to launch in continuous sprays anyway. Also, it's too hard to keep holding down the "balloons" button if we use policy DragThreshold. This is better to have on the fighters button, since the usual use case is that ballons are launched first, and cheap enough to launch continuously. Change-Id: I3b52556b81afad9fb7ec1a4b1dec4dde3bab104c Reviewed-by: Jan Arve Sæther --- tests/manual/pointer/content/MultiButton.qml | 2 +- tests/manual/pointer/multibuttons.qml | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'tests/manual') diff --git a/tests/manual/pointer/content/MultiButton.qml b/tests/manual/pointer/content/MultiButton.qml index 5b31e9ebd0..4a737dc9b0 100644 --- a/tests/manual/pointer/content/MultiButton.qml +++ b/tests/manual/pointer/content/MultiButton.qml @@ -62,7 +62,7 @@ Rectangle { objectName: label.text onTapped: { tapFlash.start() - root.tapped + root.tapped() } } diff --git a/tests/manual/pointer/multibuttons.qml b/tests/manual/pointer/multibuttons.qml index 16d2f191e7..748ec87c86 100644 --- a/tests/manual/pointer/multibuttons.qml +++ b/tests/manual/pointer/multibuttons.qml @@ -55,20 +55,21 @@ Item { id: balloonsButton label: "Launch Balloons" Layout.fillWidth: true - gesturePolicy: TapHandler.DragThreshold + gesturePolicy: TapHandler.WithinBounds } Text { text: "the goons"; font.pointSize: 12 } MultiButton { id: missilesButton - label: "Launch Missiles" + label: "Launch Missile" Layout.fillWidth: true - gesturePolicy: TapHandler.WithinBounds + gesturePolicy: TapHandler.ReleaseWithinBounds + onTapped: missileEmitter.burst(1) } MultiButton { id: fightersButton label: "Launch Fighters" Layout.fillWidth: true - gesturePolicy: TapHandler.ReleaseWithinBounds + gesturePolicy: TapHandler.DragThreshold } } ParticleSystem { @@ -90,6 +91,6 @@ Item { anchors.right: parent.right anchors.rightMargin: 100 ImageParticle { source: "resources/missile.png"; autoRotation: true; rotation: 90 } - Emitter { anchors.bottom: parent.bottom; enabled: missilesButton.pressed; lifeSpan: 5000; size: 128 - emitRate: 10; velocity: PointDirection { x: -200; y: -350; yVariation: 200; xVariation: 100 } } } + Emitter { id: missileEmitter; anchors.bottom: parent.bottom; lifeSpan: 5000; size: 128; + emitRate: 0; velocity: PointDirection { x: -200; y: -350; yVariation: 200; xVariation: 100 } } } } -- cgit v1.2.3