summaryrefslogtreecommitdiffstats
path: root/examples/declarative/toys/dynamicscene/qml/PerspectiveItem.qml
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-05-19 10:36:50 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-05-19 10:36:50 (GMT)
commitc9057924dfa5da4d18030720431a92d2593f85df (patch)
tree1cef0e0137e1d4bb796f0507b72e95ab30c96e20 /examples/declarative/toys/dynamicscene/qml/PerspectiveItem.qml
parentde0858687898f6e0e54cce3f986779c7aa1a350e (diff)
parentd395903e4d061a30117f7b925bdad41771a29067 (diff)
downloadQt-c9057924dfa5da4d18030720431a92d2593f85df.zip
Qt-c9057924dfa5da4d18030720431a92d2593f85df.tar.gz
Qt-c9057924dfa5da4d18030720431a92d2593f85df.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: (36 commits) Doc improvements Disable mouse-based selection in TextInput/TextEdit Rename qml executable to qmlviewer Don't crash if the target parent is destroyed. Introduce a threaded interpreter for QML binding bytecode Bug moved. doc doc Remove image example (covered in class docs) When changing Loader source, remove old item from scene immediately. Add missing .qmlproject files Fix folderlistmodel with qt namespace Renaming "Qml Launcher" back to "QML Viewer" Rename some examples: proxyviewer -> networkaccessmanagerfactory, Regression fix for Loader anchors not working Make Qt.include() work for js files that have '.pragma library' doc fix Improve docs for Qt.quit() Prevent assignment of values (string, number, bool) to signal handlers. Make sure strings are escaped when returned via asScript. ...
Diffstat (limited to 'examples/declarative/toys/dynamicscene/qml/PerspectiveItem.qml')
-rw-r--r--examples/declarative/toys/dynamicscene/qml/PerspectiveItem.qml25
1 files changed, 25 insertions, 0 deletions
diff --git a/examples/declarative/toys/dynamicscene/qml/PerspectiveItem.qml b/examples/declarative/toys/dynamicscene/qml/PerspectiveItem.qml
new file mode 100644
index 0000000..c04d3dc
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qml/PerspectiveItem.qml
@@ -0,0 +1,25 @@
+import Qt 4.7
+
+Image {
+ id: rootItem
+
+ property bool created: false
+ property string image
+
+ property double scaledBottom: y + (height + height*scale) / 2
+ property bool onLand: scaledBottom > window.height / 2
+
+ source: image
+ opacity: onLand ? 1 : 0.25
+ scale: Math.max((y + height - 250) * 0.01, 0.3)
+ smooth: true
+
+ onCreatedChanged: {
+ if (created && !onLand)
+ rootItem.destroy();
+ else
+ z = scaledBottom;
+ }
+
+ onYChanged: z = scaledBottom;
+}