diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2016-10-18 18:45:49 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-03-07 12:24:55 +0000 |
commit | 95d1ff465c292445d36fa071b1f37a8cdaa2d7aa (patch) | |
tree | ff953891c780d8fe4f193669d5697e6c5460e8c7 | |
parent | 2f204d3e6a4e5107e09e9b87b841fe91bb6743ac (diff) |
TapHandler manual test: demonstrate tapped signal
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 <jan-arve.saether@qt.io>
-rw-r--r-- | tests/manual/pointer/content/MultiButton.qml | 2 | ||||
-rw-r--r-- | tests/manual/pointer/multibuttons.qml | 13 |
2 files changed, 8 insertions, 7 deletions
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 } } } } |