diff options
-rw-r--r-- | Qt/examples/declarative/pincharea/pincharea.qml | 32 | ||||
-rw-r--r-- | Qt/examples/declarative/textedit/textedit.qml | 16 | ||||
-rw-r--r-- | Qt/examples/declarative/textinput/textinput.qml | 15 |
3 files changed, 50 insertions, 13 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/textedit/textedit.qml b/Qt/examples/declarative/textedit/textedit.qml index 771250d..91d1ee2 100644 --- a/Qt/examples/declarative/textedit/textedit.qml +++ b/Qt/examples/declarative/textedit/textedit.qml @@ -42,6 +42,7 @@ import QtQuick 1.1 Rectangle { + height: 360; width: 640; color: "gray" Rectangle { id: textedit1box; width: 200; height: 30; color: "green" @@ -229,4 +230,19 @@ Rectangle { } } } + + 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 } + } }
\ No newline at end of file diff --git a/Qt/examples/declarative/textinput/textinput.qml b/Qt/examples/declarative/textinput/textinput.qml index 999f1af..70b3ebf 100644 --- a/Qt/examples/declarative/textinput/textinput.qml +++ b/Qt/examples/declarative/textinput/textinput.qml @@ -266,4 +266,19 @@ Rectangle { } } } + + 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 } + } }
\ No newline at end of file |