summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormae <qt-info@nokia.com>2010-03-03 18:39:45 (GMT)
committermae <qt-info@nokia.com>2010-03-03 18:39:45 (GMT)
commit1a7df5ef1fc81fbf2d548c40e3feeb8ef3bb5a8c (patch)
treebd482c10ffde3ceefae5d4ed8f09f87f8c05bccf
parenta2af08f9793b3884bdb770f89edd4754c0411654 (diff)
downloadQt-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.
-rw-r--r--examples/declarative/dynamic/qml/Sun.qml8
-rw-r--r--examples/declarative/imageprovider/imageprovider.qml2
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