summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-08-04 04:03:23 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-08-04 04:03:23 (GMT)
commitded11a8737bf1828c0c4e188ec26af06f590e990 (patch)
treed08c93a18148787ed22a4c0fe6fad8acc0ac7726 /demos
parentdf08e9135e4aec7ba9ff1e3519cc17cdebd97f6d (diff)
parent8e11af2579a976f4d8d839d814de19e25c912bae (diff)
downloadQt-ded11a8737bf1828c0c4e188ec26af06f590e990.zip
Qt-ded11a8737bf1828c0c4e188ec26af06f590e990.tar.gz
Qt-ded11a8737bf1828c0c4e188ec26af06f590e990.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Don't crash if an item is removed from the scene while it is gaining focus. Add missing snippet file Snake game cannot be restarted
Diffstat (limited to 'demos')
-rw-r--r--demos/declarative/snake/snake.qml17
1 files changed, 15 insertions, 2 deletions
diff --git a/demos/declarative/snake/snake.qml b/demos/declarative/snake/snake.qml
index 46114f5..b1344af 100644
--- a/demos/declarative/snake/snake.qml
+++ b/demos/declarative/snake/snake.qml
@@ -208,17 +208,30 @@ Rectangle {
Keys.onUpPressed: if (state == "starting" || direction != 2) Logic.scheduleDirection(0);
Keys.onDownPressed: if (state == "starting" || direction != 0) Logic.scheduleDirection(2);
+ Connections {
+ target: startHeartbeatTimer
+ onRunningChanged: {
+ if (startHeartbeatTimer.running)
+ screen.state = "starting";
+ else
+ screen.state = "running"
+ }
+ }
+ Connections {
+ target: heartbeat
+ onRunningChanged: if (!heartbeat.running) screen.state = "";
+ }
+
+
states: [
State {
name: "starting"
- when: startHeartbeatTimer.running
PropertyChanges {target: progressIndicator; width: 200}
PropertyChanges {target: title; opacity: 0}
PropertyChanges {target: progressBar; opacity: 1}
},
State {
name: "running"
- when: (heartbeat.running && !startHeartbeatTimer.running)
PropertyChanges {target: progressIndicator; width: 200}
PropertyChanges {target: title; opacity: 0}
PropertyChanges {target: skull; row: 0; column: 0; }