summaryrefslogtreecommitdiffstats
path: root/examples/declarative/dynamic
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2009-11-09 08:28:04 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2009-11-09 08:28:04 (GMT)
commit82566a4137e23ab73f7853d897e5702b686054cf (patch)
tree653817ba3e773c3804959722b0ad326df8279cca /examples/declarative/dynamic
parentdbbe24f0f04e5a0aaf9223b73bee873e208a1fa7 (diff)
downloadQt-82566a4137e23ab73f7853d897e5702b686054cf.zip
Qt-82566a4137e23ab73f7853d897e5702b686054cf.tar.gz
Qt-82566a4137e23ab73f7853d897e5702b686054cf.tar.bz2
Fix perspective in dynamic example
working Z and items can no longer be placed in the sky (due to scaling).
Diffstat (limited to 'examples/declarative/dynamic')
-rw-r--r--examples/declarative/dynamic/qml/PerspectiveItem.qml11
-rw-r--r--examples/declarative/dynamic/qml/itemCreation.js2
2 files changed, 8 insertions, 5 deletions
diff --git a/examples/declarative/dynamic/qml/PerspectiveItem.qml b/examples/declarative/dynamic/qml/PerspectiveItem.qml
index 55a70d5..728c3a5 100644
--- a/examples/declarative/dynamic/qml/PerspectiveItem.qml
+++ b/examples/declarative/dynamic/qml/PerspectiveItem.qml
@@ -3,10 +3,13 @@ import Qt 4.6
Image {
id: tree
property bool created: false
- opacity: y+height > window.height/2 ? 1 : 0.25
- onCreatedChanged: if (created && y+height<=window.height/2) { tree.destroy() }
- scale: y+height > window.height/2 ? (y+height-250)*0.01 : 1
+ 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
- z: y
+ onYChanged: z = scaledBottom
}
diff --git a/examples/declarative/dynamic/qml/itemCreation.js b/examples/declarative/dynamic/qml/itemCreation.js
index b3e8ba5..ccc03aa 100644
--- a/examples/declarative/dynamic/qml/itemCreation.js
+++ b/examples/declarative/dynamic/qml/itemCreation.js
@@ -32,7 +32,7 @@ function loadComponent() {
createItem();
itemComponent = createComponent(itemButton.file);
- print(itemButton.file)
+ //print(itemButton.file)
if(itemComponent.isLoading){
component.statusChanged.connect(finishCreation);
}else{//Depending on the content, it can be ready or error immediately