diff options
author | Damian Jansen <damian.jansen@nokia.com> | 2011-05-09 12:51:54 +1000 |
---|---|---|
committer | Damian Jansen <damian.jansen@nokia.com> | 2011-05-09 12:51:54 +1000 |
commit | c79424705a4b9e8abdc54add1f50e0c89f893999 (patch) | |
tree | d007865fdf6187029cd289cfbf87b022fbe8db43 | |
parent | c610798aecc76f374c54ed7e7c41119600b858b9 (diff) |
Fix orientation issue and incorrect values in test application
-rw-r--r-- | Qt/examples/declarative/pincharea/pincharea.qml | 32 | ||||
-rw-r--r-- | Qt/examples/declarative/textinput/textinput.qml | 2 |
2 files changed, 20 insertions, 14 deletions
diff --git a/Qt/examples/declarative/pincharea/pincharea.qml b/Qt/examples/declarative/pincharea/pincharea.qml index 2383851..98af88f 100644 --- a/Qt/examples/declarative/pincharea/pincharea.qml +++ b/Qt/examples/declarative/pincharea/pincharea.qml @@ -48,12 +48,7 @@ Rectangle { PinchArea { id: pinchy - property int xpoint - property int ypoint - property real pinchscale - property int pinchrotation pinch.target: logo - pinchscale: pinch.target.scale enabled: false anchors.fill: parent pinch.dragAxis: Pinch.XandYAxis @@ -65,14 +60,10 @@ Rectangle { pinch.maximumY: 300 pinch.minimumRotation: -150 pinch.maximumRotation: 150 - onPinchUpdated: { xpoint = pinch.center.x; ypoint = pinch.center.y; pinchrotation = pinch.rotation; pinchscale = pinch.target.scale } } Rectangle { - id: logo; width: 200; height: 200 - x: 100 - y: 100 - color: "white" + id: logo; width: 200; height: 200; x: 100; y: 100; color: "white" Image { anchors.fill: parent source: "qt-logo.jpg" @@ -91,13 +82,13 @@ Rectangle { Item { Column { Text { - text: "Scale: " + pinchy.pinchscale + " (" + pinchy.pinch.minimumScale + "/" + pinchy.pinch.maximumScale + ")" + text: "Scale: " + pinchy.pinch.target.scale + " (" + pinchy.pinch.minimumScale + "/" + pinchy.pinch.maximumScale + ")" } Text { - text: "Coord: " + pinchy.xpoint + "/" + pinchy.ypoint + " (" + pinchy.pinch.minimumX + "/" + pinchy.pinch.maximumX + "," + pinchy.pinch.minimumY + "/" + pinchy.pinch.maximumY + ")" + text: "Coord: " + pinchy.pinch.target.x + "/" + pinchy.pinch.target.y + " (" + pinchy.pinch.minimumX + "/" + pinchy.pinch.maximumX + "," + pinchy.pinch.minimumY + "/" + pinchy.pinch.maximumY + ")" } Text { - text: "Rotation: " + pinchy.pinchrotation + " (" + pinchy.pinch.minimumRotation + "/" + pinchy.pinch.maximumRotation + ")" + text: "Rotation: " + pinchy.pinch.target.rotation + " (" + pinchy.pinch.minimumRotation + "/" + pinchy.pinch.maximumRotation + ")" } } } @@ -111,4 +102,19 @@ Rectangle { Text { anchors.centerIn: parent; text: "Reload" } MouseArea { anchors.fill: parent; onClicked: { qmlViewer.reload(); } } } + + Item { + height: runtime.orientation != 2 ? parent.height : 0 + Behavior on height { NumberAnimation { duration: 200 } } + width: runtime.orientation != 2 ? parent.width : 0 + Behavior on width { NumberAnimation { duration: 200 } } + anchors.centerIn: parent + Rectangle { + height: parent.height - 15; width: parent.width - 15; color: "green"; radius: 10; anchors.centerIn: parent; border.color: "blue" + Text { visible: runtime.orientation != 2; width: parent.width - 30; anchors.centerIn: parent; horizontalAlignment: Text.AlignHCenter + text: "Please change to landscape orientation\nvia the Settings menu, or\nrotating the device" + } + } + MouseArea { anchors.fill: parent } + } } diff --git a/Qt/examples/declarative/textinput/textinput.qml b/Qt/examples/declarative/textinput/textinput.qml index 916dedb..70b3ebf 100644 --- a/Qt/examples/declarative/textinput/textinput.qml +++ b/Qt/examples/declarative/textinput/textinput.qml @@ -276,7 +276,7 @@ Rectangle { Rectangle { height: parent.height - 15; width: parent.width - 15; color: "green"; radius: 10; anchors.centerIn: parent; border.color: "blue" Text { visible: runtime.orientation != 2; width: parent.width - 30; anchors.centerIn: parent; horizontalAlignment: Text.AlignHCenter - text: "Please change to landscape orientation\nvia the Settings menu" + text: "Please change to landscape orientation\nvia the Settings menu, or\nrotating the device" } } MouseArea { anchors.fill: parent } |