From e5f169eaff00b68a233a76ddbac97201d819bc28 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Thu, 25 Feb 2010 14:16:01 +1000 Subject: Connections example could be turned incorrectly Task-number: QTBUG-8345 --- examples/declarative/connections/connections.qml | 12 ++++-------- 1 file 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 } } -- cgit v0.12