summaryrefslogtreecommitdiffstats
path: root/examples/declarative/dynamic/qml/Sun.qml
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2009-10-30 03:36:19 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2009-10-30 03:36:19 (GMT)
commitf37e9d787bd418d8f75997a8d46c1c42e842c673 (patch)
tree8e11076675fa02740d5d5ca490b5dc09adc16bdf /examples/declarative/dynamic/qml/Sun.qml
parent72932c6683729071c1acb3f4832c5dc53a561bdd (diff)
downloadQt-f37e9d787bd418d8f75997a8d46c1c42e842c673.zip
Qt-f37e9d787bd418d8f75997a8d46c1c42e842c673.tar.gz
Qt-f37e9d787bd418d8f75997a8d46c1c42e842c673.tar.bz2
cleanup
Diffstat (limited to 'examples/declarative/dynamic/qml/Sun.qml')
-rw-r--r--examples/declarative/dynamic/qml/Sun.qml24
1 files changed, 24 insertions, 0 deletions
diff --git a/examples/declarative/dynamic/qml/Sun.qml b/examples/declarative/dynamic/qml/Sun.qml
new file mode 100644
index 0000000..796a370
--- /dev/null
+++ b/examples/declarative/dynamic/qml/Sun.qml
@@ -0,0 +1,24 @@
+import Qt 4.6
+
+Image {
+ id: sun
+ property bool created: false
+ property string image: "../images/sun.png"
+ onCreatedChanged: if(created){window.activeSuns++;}else{window.activeSuns--;}
+
+ source: image;
+ z: 1
+
+ //x and y get set when instantiated
+ //head offscreen
+ y: NumberAnimation {
+ to: parent.height;
+ duration: 10000;
+ running: created
+ }
+
+ states: State {
+ name: "OffScreen"; when: created && y > window.height / 2;//Below the ground
+ StateChangeScript { script: { sun.created = false; sun.destroy() } }
+ }
+}