diff options
author | Morten Johan Sørvig <morten.sorvig@nokia.com> | 2010-05-12 07:42:52 (GMT) |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@nokia.com> | 2010-05-12 07:42:52 (GMT) |
commit | 731a2f16578ead0f75f2752e757b138376b2f872 (patch) | |
tree | 2b6f9746771992f97cbdb5cf5af8f35ac6928b26 /examples/declarative/dynamic/qml/PerspectiveItem.qml | |
parent | 37475bcc4aef3f08c5917f22c7f0f427e4214b91 (diff) | |
parent | b4c589868f278aa9a58ab9afa727dbf0a9442e22 (diff) | |
download | Qt-731a2f16578ead0f75f2752e757b138376b2f872.zip Qt-731a2f16578ead0f75f2752e757b138376b2f872.tar.gz Qt-731a2f16578ead0f75f2752e757b138376b2f872.tar.bz2 |
Merge remote branch 'mainline/4.7' into 4.7
Conflicts:
src/declarative/qml/qdeclarativeengine.cpp
tools/qdoc3/htmlgenerator.cpp
Diffstat (limited to 'examples/declarative/dynamic/qml/PerspectiveItem.qml')
-rw-r--r-- | examples/declarative/dynamic/qml/PerspectiveItem.qml | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/examples/declarative/dynamic/qml/PerspectiveItem.qml b/examples/declarative/dynamic/qml/PerspectiveItem.qml index 3cbe64a..c04d3dc 100644 --- a/examples/declarative/dynamic/qml/PerspectiveItem.qml +++ b/examples/declarative/dynamic/qml/PerspectiveItem.qml @@ -1,16 +1,25 @@ import Qt 4.7 Image { - id: tree + id: rootItem + 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 - property string image //Needed for compatibility with GenericItem + 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 - onCreatedChanged: if (created && !onLand) { tree.destroy() } else { z = scaledBottom } - scale: scaleFactor - transformOrigin: "Center" - source: image; smooth: true - onYChanged: z = scaledBottom + scale: Math.max((y + height - 250) * 0.01, 0.3) + smooth: true + + onCreatedChanged: { + if (created && !onLand) + rootItem.destroy(); + else + z = scaledBottom; + } + + onYChanged: z = scaledBottom; } |