aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/touch/bearwhack/AugmentedTouchPoint.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/touch/bearwhack/AugmentedTouchPoint.qml')
-rw-r--r--tests/manual/touch/bearwhack/AugmentedTouchPoint.qml35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/manual/touch/bearwhack/AugmentedTouchPoint.qml b/tests/manual/touch/bearwhack/AugmentedTouchPoint.qml
new file mode 100644
index 0000000000..6c7a4127fa
--- /dev/null
+++ b/tests/manual/touch/bearwhack/AugmentedTouchPoint.qml
@@ -0,0 +1,35 @@
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+import QtQuick
+import QtQuick.Particles
+
+//! [0]
+TouchPoint {
+ id: container
+ property ParticleSystem system
+ onPressedChanged: {
+ if (pressed) {
+ timer.restart();
+ child.enabled = true;
+ system.explode(x,y);
+ }
+ }
+ property QtObject obj: Timer {
+ id: timer
+ interval: 100
+ running: false
+ repeat: false
+ onTriggered: container.child.enabled = false
+ }
+ property Item child: SpriteGoal {
+ enabled: false
+ x: container.area.x - 16
+ y: container.area.y - 16
+ width: container.area.width + 32
+ height: container.area.height + 32 //+32 so it doesn't have to hit the exact center
+ system: container.system
+ parent: container.system
+ goalState: "falling"
+ }
+}
+//! [0]