summaryrefslogtreecommitdiffstats
path: root/examples/declarative/dynamic/qml/PerspectiveItem.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/dynamic/qml/PerspectiveItem.qml')
-rw-r--r--examples/declarative/dynamic/qml/PerspectiveItem.qml15
1 files changed, 15 insertions, 0 deletions
diff --git a/examples/declarative/dynamic/qml/PerspectiveItem.qml b/examples/declarative/dynamic/qml/PerspectiveItem.qml
new file mode 100644
index 0000000..728c3a5
--- /dev/null
+++ b/examples/declarative/dynamic/qml/PerspectiveItem.qml
@@ -0,0 +1,15 @@
+import Qt 4.6
+
+Image {
+ id: tree
+ property bool created: false
+ property double scaleFactor: Math.max((y+height-250)*0.01, 0.3)
+ property double scaledBottom: y + (height+height*scaleFactor)/2
+ property bool onLand: scaledBottom > window.height/2
+ opacity: onLand ? 1 : 0.25
+ onCreatedChanged: if (created && !onLand) { tree.destroy() } else { z = scaledBottom }
+ scale: scaleFactor
+ transformOrigin: "Center"
+ source: image; smooth: true
+ onYChanged: z = scaledBottom
+}