diff options
Diffstat (limited to 'examples/declarative/dynamic')
-rw-r--r-- | examples/declarative/dynamic/PerspectiveItem.qml | 12 | ||||
-rw-r--r-- | examples/declarative/dynamic/dynamic.qml | 8 |
2 files changed, 15 insertions, 5 deletions
diff --git a/examples/declarative/dynamic/PerspectiveItem.qml b/examples/declarative/dynamic/PerspectiveItem.qml new file mode 100644 index 0000000..9e09dd2 --- /dev/null +++ b/examples/declarative/dynamic/PerspectiveItem.qml @@ -0,0 +1,12 @@ +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 + transformOrigin: "Center" + source: image; + z: y +} diff --git a/examples/declarative/dynamic/dynamic.qml b/examples/declarative/dynamic/dynamic.qml index e083a5b..ea4e0cd 100644 --- a/examples/declarative/dynamic/dynamic.qml +++ b/examples/declarative/dynamic/dynamic.qml @@ -68,30 +68,28 @@ Item { Text{ text: "Drag an item into the scene." } Row{ id: toolRow spacing: 8; - height: childrenRect.height//TODO: Put bug in JIRA when it comes back up PaletteItem{ anchors.verticalCenter: parent.verticalCenter file: "Sun.qml"; image: "images/sun.png" } PaletteItem{ - anchors.verticalCenter: parent.verticalCenter file: "GenericItem.qml" image: "images/moon.png" } PaletteItem{ anchors.verticalCenter: parent.verticalCenter - file: "GenericItem.qml" + file: "PerspectiveItem.qml" image: "images/tree_s.png" } PaletteItem{ anchors.verticalCenter: parent.verticalCenter - file: "GenericItem.qml" + file: "PerspectiveItem.qml" image: "images/rabbit_brown.png" } PaletteItem{ anchors.verticalCenter: parent.verticalCenter - file: "GenericItem.qml" + file: "PerspectiveItem.qml" image: "images/rabbit_bw.png" } } |