diff options
author | Yann Bodson <yann.bodson@nokia.com> | 2010-05-06 02:42:36 (GMT) |
---|---|---|
committer | Yann Bodson <yann.bodson@nokia.com> | 2010-05-06 02:42:36 (GMT) |
commit | 3e4116ff5337d41466904b2e381dfa74267264a8 (patch) | |
tree | b9bf47c83bc9fd5bc82caf72a0a43d99a59eb0c7 /examples | |
parent | c16cc8c4d03cb062c5164295cad75509ec31feaf (diff) | |
download | Qt-3e4116ff5337d41466904b2e381dfa74267264a8.zip Qt-3e4116ff5337d41466904b2e381dfa74267264a8.tar.gz Qt-3e4116ff5337d41466904b2e381dfa74267264a8.tar.bz2 |
Cleanup
Diffstat (limited to 'examples')
7 files changed, 18 insertions, 26 deletions
diff --git a/examples/declarative/animations/color-animation.qml b/examples/declarative/animations/color-animation.qml index 3616a31..61737e9 100644 --- a/examples/declarative/animations/color-animation.qml +++ b/examples/declarative/animations/color-animation.qml @@ -31,15 +31,14 @@ Item { // the sun, moon, and stars Item { width: parent.width; height: 2 * parent.height - transformOrigin: Item.Center NumberAnimation on rotation { from: 0; to: 360; duration: 10000; loops: Animation.Infinite } Image { source: "images/sun.png"; y: 10; anchors.horizontalCenter: parent.horizontalCenter - transformOrigin: Item.Center; rotation: -3 * parent.rotation + rotation: -3 * parent.rotation } Image { source: "images/moon.png"; y: parent.height - 74; anchors.horizontalCenter: parent.horizontalCenter - transformOrigin: Item.Center; rotation: -parent.rotation + rotation: -parent.rotation } Particles { x: 0; y: parent.height/2; width: parent.width; height: parent.height/2 diff --git a/examples/declarative/animations/property-animation.qml b/examples/declarative/animations/property-animation.qml index 6360511..87ac8ec 100644 --- a/examples/declarative/animations/property-animation.qml +++ b/examples/declarative/animations/property-animation.qml @@ -26,7 +26,6 @@ Item { Image { anchors.horizontalCenter: parent.horizontalCenter source: "images/shadow.png"; y: smiley.minHeight + 58 - transformOrigin: Item.Center // The scale property depends on the y position of the smiley face. scale: smiley.y * 0.5 / (smiley.minHeight - smiley.maxHeight) diff --git a/examples/declarative/connections/connections-example.qml b/examples/declarative/connections/connections-example.qml index 1dd10ab..e65a280 100644 --- a/examples/declarative/connections/connections-example.qml +++ b/examples/declarative/connections/connections-example.qml @@ -13,7 +13,6 @@ Rectangle { id: image source: "content/bg1.jpg" anchors.centerIn: parent - transformOrigin: Item.Center rotation: window.angle Behavior on rotation { diff --git a/examples/declarative/dynamic/qml/PerspectiveItem.qml b/examples/declarative/dynamic/qml/PerspectiveItem.qml index 3cbe64a..6d763c3 100644 --- a/examples/declarative/dynamic/qml/PerspectiveItem.qml +++ b/examples/declarative/dynamic/qml/PerspectiveItem.qml @@ -4,13 +4,12 @@ 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 double scaledBottom: y + (height+height*scaleFactor)/2 property bool onLand: scaledBottom > window.height/2 property string image //Needed for compatibility with GenericItem 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 } diff --git a/examples/declarative/listview/dynamic.qml b/examples/declarative/listview/dynamic.qml index 236a9c5..952f6a7 100644 --- a/examples/declarative/listview/dynamic.qml +++ b/examples/declarative/listview/dynamic.qml @@ -56,7 +56,7 @@ Rectangle { Item { width: container.width; height: 55 - + Column { id: moveButtons x: 5; width: childrenRect.width; anchors.verticalCenter: parent.verticalCenter @@ -84,7 +84,7 @@ Rectangle { spacing: 5 Repeater { model: attributes - Component { + Component { Text { text: description; color: "White" } } } @@ -95,13 +95,12 @@ Rectangle { id: itemButtons anchors { right: removeButton.left; rightMargin: 35; verticalCenter: parent.verticalCenter } - width: childrenRect.width + width: childrenRect.width spacing: 10 Image { source: "content/pics/list-add.png" scale: clickUp.isPressed ? 0.9 : 1 - transformOrigin: Item.Center ClickAutoRepeating { id: clickUp @@ -115,9 +114,8 @@ Rectangle { Image { source: "content/pics/list-remove.png" scale: clickDown.isPressed ? 0.9 : 1 - transformOrigin: Item.Center - ClickAutoRepeating { + ClickAutoRepeating { id: clickDown anchors.fill: parent onClicked: fruitModel.setProperty(index, "cost", Math.max(0,cost-0.25)) @@ -158,7 +156,7 @@ Rectangle { } transitions: Transition { NumberAnimation { properties: "opacity"; duration: 400 } - } + } } Row { @@ -198,10 +196,10 @@ Rectangle { } } - Image { + Image { source: "content/pics/archive-remove.png" - MouseArea { + MouseArea { anchors.fill: parent onClicked: fruitModel.clear() } diff --git a/examples/declarative/parallax/qml/ParallaxView.qml b/examples/declarative/parallax/qml/ParallaxView.qml index 4b38d45..e869a21 100644 --- a/examples/declarative/parallax/qml/ParallaxView.qml +++ b/examples/declarative/parallax/qml/ParallaxView.qml @@ -18,9 +18,9 @@ Item { id: list currentIndex: root.currentIndex - onCurrentIndexChanged: root.currentIndex = currentIndex + onCurrentIndexChanged: root.currentIndex = currentIndex - orientation: "Horizontal" + orientation: Qt.Horizontal boundsBehavior: Flickable.DragOverBounds anchors.fill: parent model: VisualItemModel { id: visualModel } @@ -45,10 +45,10 @@ Item { anchors.horizontalCenter: parent.horizontalCenter width: Math.min(count * 50, parent.width - 20) interactive: width == parent.width - 20 - orientation: "Horizontal" + orientation: Qt.Horizontal - delegate: Item { - width: 50; height: 50 + delegate: Item { + width: 50; height: 50 id: delegateRoot Image { @@ -56,7 +56,6 @@ Item { source: modelData.icon smooth: true scale: 0.8 - transformOrigin: "Center" } MouseArea { @@ -64,10 +63,10 @@ Item { onClicked: { root.currentIndex = index } } - states: State { + states: State { name: "Selected" when: delegateRoot.ListView.isCurrentItem == true - PropertyChanges { + PropertyChanges { target: image scale: 1 y: -5 diff --git a/examples/declarative/parallax/qml/Smiley.qml b/examples/declarative/parallax/qml/Smiley.qml index cfa4fed..662addc 100644 --- a/examples/declarative/parallax/qml/Smiley.qml +++ b/examples/declarative/parallax/qml/Smiley.qml @@ -8,7 +8,6 @@ Item { Image { anchors.horizontalCenter: parent.horizontalCenter source: "../pics/shadow.png"; y: smiley.minHeight + 58 - transformOrigin: Item.Center // The scale property depends on the y position of the smiley face. scale: smiley.y * 0.5 / (smiley.minHeight - smiley.maxHeight) @@ -32,7 +31,7 @@ Item { from: smiley.minHeight; to: smiley.maxHeight easing.type: Easing.OutExpo; duration: 300 } - + // Then move back to minHeight in 1 second, using the OutBounce easing function NumberAnimation { from: smiley.maxHeight; to: smiley.minHeight |