summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorJoona Petrell <joona.t.petrell@nokia.com>2010-07-07 05:45:33 (GMT)
committerJoona Petrell <joona.t.petrell@nokia.com>2010-07-07 06:23:15 (GMT)
commitaf5fc41e27f068604453a927cac4d81886d1987e (patch)
tree5315176c3680f844a9e86213334234996a65dd80 /demos
parent44d78dca77b8a5f4f0d1bb67e84c21a4c57345b6 (diff)
downloadQt-af5fc41e27f068604453a927cac4d81886d1987e.zip
Qt-af5fc41e27f068604453a927cac4d81886d1987e.tar.gz
Qt-af5fc41e27f068604453a927cac4d81886d1987e.tar.bz2
Add Symbian support for runtime.orientation property
Task-number: Reviewed-by: Martin Jones
Diffstat (limited to 'demos')
-rw-r--r--demos/declarative/calculator/Core/calculator.js2
-rw-r--r--demos/declarative/calculator/calculator.qml29
2 files changed, 22 insertions, 9 deletions
diff --git a/demos/declarative/calculator/Core/calculator.js b/demos/declarative/calculator/Core/calculator.js
index 51b3dd3..c80c42f 100644
--- a/demos/declarative/calculator/Core/calculator.js
+++ b/demos/declarative/calculator/Core/calculator.js
@@ -84,7 +84,7 @@ function doOperation(op) {
}
if (op == rotateLeft)
- main.state = 'rotated'
+ main.state = "orientation " + Orientation.Landscape
if (op == rotateRight)
main.state = ''
}
diff --git a/demos/declarative/calculator/calculator.qml b/demos/declarative/calculator/calculator.qml
index 3d36211..63b6c55 100644
--- a/demos/declarative/calculator/calculator.qml
+++ b/demos/declarative/calculator/calculator.qml
@@ -58,10 +58,11 @@ Rectangle {
property string plusminus : "\u00b1"
function doOp(operation) { CalcEngine.doOperation(operation) }
-
+
Item {
id: main
- state: (runtime.orientation == Orientation.Portrait) ? '' : 'rotated'
+ state: "orientation " + runtime.orientation
+
width: parent.width; height: parent.height; anchors.centerIn: parent
Column {
@@ -130,16 +131,28 @@ Rectangle {
}
}
- states: State {
- name: 'rotated'
- PropertyChanges { target: main; rotation: -90; width: window.height; height: window.width }
- PropertyChanges { target: rotateButton; operation: rotateRight }
- }
+ states: [
+ State {
+ name: "orientation " + Orientation.Landscape
+ PropertyChanges { target: main; rotation: -90; width: window.height; height: window.width }
+ PropertyChanges { target: rotateButton; operation: rotateRight }
+ },
+ State {
+ name: "orientation " + Orientation.PortraitInverted
+ PropertyChanges { target: main; rotation: -180; }
+ PropertyChanges { target: rotateButton; operation: rotateLeft }
+ },
+ State {
+ name: "orientation " + Orientation.LandscapeInverted
+ PropertyChanges { target: main; rotation: -270; width: window.height; height: window.width }
+ PropertyChanges { target: rotateButton; operation: rotateRight }
+ }
+ ]
transitions: Transition {
SequentialAnimation {
PropertyAction { target: rotateButton; property: "operation" }
- NumberAnimation { properties: "rotation"; duration: 300; easing.type: Easing.InOutQuint }
+ RotationAnimation { direction: RotationAnimation.Shortest; duration: 300; easing.type: Easing.InOutQuint }
NumberAnimation { properties: "x,y,width,height"; duration: 300; easing.type: Easing.InOutQuint }
}
}