From 1a7df5ef1fc81fbf2d548c40e3feeb8ef3bb5a8c Mon Sep 17 00:00:00 2001 From: mae Date: Wed, 3 Mar 2010 19:39:45 +0100 Subject: 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. --- examples/declarative/dynamic/qml/Sun.qml | 8 ++++---- examples/declarative/imageprovider/imageprovider.qml | 2 +- 2 files changed, 5 insertions(+), 5 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() } } } } diff --git a/examples/declarative/imageprovider/imageprovider.qml b/examples/declarative/imageprovider/imageprovider.qml index a1f2794..f899b1e 100644 --- a/examples/declarative/imageprovider/imageprovider.qml +++ b/examples/declarative/imageprovider/imageprovider.qml @@ -1,5 +1,5 @@ import Qt 4.6 -import ImageProviderCore 1.0 +import "ImageProviderCore" //![0] ListView { width: 100 -- cgit v0.12