diff options
author | mae <qt-info@nokia.com> | 2010-03-03 18:39:45 (GMT) |
---|---|---|
committer | mae <qt-info@nokia.com> | 2010-03-03 18:39:45 (GMT) |
commit | 1a7df5ef1fc81fbf2d548c40e3feeb8ef3bb5a8c (patch) | |
tree | bd482c10ffde3ceefae5d4ed8f09f87f8c05bccf /examples/declarative/dynamic/qml | |
parent | a2af08f9793b3884bdb770f89edd4754c0411654 (diff) | |
download | Qt-1a7df5ef1fc81fbf2d548c40e3feeb8ef3bb5a8c.zip Qt-1a7df5ef1fc81fbf2d548c40e3feeb8ef3bb5a8c.tar.gz Qt-1a7df5ef1fc81fbf2d548c40e3feeb8ef3bb5a8c.tar.bz2 |
make example work again
The code is now a bit on the imperative side, but that was the
only working solution to remove the binding loops.
Diffstat (limited to 'examples/declarative/dynamic/qml')
-rw-r--r-- | examples/declarative/dynamic/qml/Sun.qml | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/declarative/dynamic/qml/Sun.qml b/examples/declarative/dynamic/qml/Sun.qml index 796a370..81b6e9b 100644 --- a/examples/declarative/dynamic/qml/Sun.qml +++ b/examples/declarative/dynamic/qml/Sun.qml @@ -11,14 +11,14 @@ Image { //x and y get set when instantiated //head offscreen - y: NumberAnimation { - to: parent.height; - duration: 10000; + NumberAnimation on y { + to: window.height / 2; running: created + onRunningChanged: if (running) duration = (window.height - sun.y) * 10; else state = "OffScreen"; } states: State { - name: "OffScreen"; when: created && y > window.height / 2;//Below the ground + name: "OffScreen"; StateChangeScript { script: { sun.created = false; sun.destroy() } } } } |