diff options
author | Yann Bodson <yann.bodson@nokia.com> | 2010-02-25 04:16:01 (GMT) |
---|---|---|
committer | Yann Bodson <yann.bodson@nokia.com> | 2010-02-25 04:16:01 (GMT) |
commit | e5f169eaff00b68a233a76ddbac97201d819bc28 (patch) | |
tree | 27ffae447237849219bf655c57946e267aa772de /examples/declarative | |
parent | f6d75a6023e0d10ed61a9a0d952059edc51a0a40 (diff) | |
download | Qt-e5f169eaff00b68a233a76ddbac97201d819bc28.zip Qt-e5f169eaff00b68a233a76ddbac97201d819bc28.tar.gz Qt-e5f169eaff00b68a233a76ddbac97201d819bc28.tar.bz2 |
Connections example could be turned incorrectly
Task-number: QTBUG-8345
Diffstat (limited to 'examples/declarative')
-rw-r--r-- | examples/declarative/connections/connections.qml | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/examples/declarative/connections/connections.qml b/examples/declarative/connections/connections.qml index ef2cb54..c140017 100644 --- a/examples/declarative/connections/connections.qml +++ b/examples/declarative/connections/connections.qml @@ -5,15 +5,11 @@ Rectangle { id: window; color: "#646464" width: 640; height: 480 - function turnLeft() { - image.rotation -= 90 - } - function turnRight() { - image.rotation += 90 - } + property int angle: 0 Image { id: image; source: "content/bg1.jpg"; anchors.centerIn: parent; transformOrigin: Item.Center + rotation: window.angle rotation: Behavior { NumberAnimation { easing.type: "OutCubic"; duration: 300 } } } @@ -26,6 +22,6 @@ Rectangle { anchors { right: parent.right; bottom: parent.bottom; rightMargin: 10; bottomMargin: 10 } } - Connection { sender: leftButton; signal: "clicked()"; script: window.turnLeft() } - Connection { sender: rightButton; signal: "clicked()"; script: window.turnRight() } + Connection { sender: leftButton; signal: "clicked()"; script: window.angle -= 90 } + Connection { sender: rightButton; signal: "clicked()"; script: window.angle += 90 } } |