summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGatis Paeglis <gatis.paeglis@digia.com>2013-09-30 09:10:20 +0200
committerGatis Paeglis <gatis.paeglis@digia.com>2013-10-02 11:38:52 +0300
commit5f753c4e86244ac1f8229316cc286d61813fb49f (patch)
treea1f9aa558f6aeee38028343736bf3b8f432707e1
parentcabbaadfe2a99f07ec065da0b356978636a8debc (diff)
Add example for Switching Between Portrait and Landscape Views
Change-Id: Ife9dbcb5c672e76e721d26ee04ca049842b3f732 Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
-rw-r--r--src/doc/src/b2qt.qdoc37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/doc/src/b2qt.qdoc b/src/doc/src/b2qt.qdoc
index 3fe0b34..9f1aa51 100644
--- a/src/doc/src/b2qt.qdoc
+++ b/src/doc/src/b2qt.qdoc
@@ -614,6 +614,43 @@
\code
<SDK_INSTALL_DIR>/targets/android-utils/bin/adb shell appcontroller --remove-default
\endcode
+
+ \section1 Switching Between Portrait and Landscape Views
+
+ Depending on a device screen dimensions and application requirements it might be desirable
+ to change the default view orientation. The following example shows how to rotate your
+ application in QML.
+
+ \code
+ import QtQuick 2.0
+
+ Item {
+ id: root
+ width: 800
+ height: 1280
+ // Container element for rotating
+ Rectangle {
+ id: main
+ // Swap the width and height of the root item
+ width: root.height
+ height: root.width
+ anchors.centerIn: parent
+ // Rotate 90 degrees clockwise around transformOrigin
+ rotation: 90
+ // The rotated content
+ Text {
+ text: qsTr("Hello World")
+ anchors.centerIn: parent
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ Qt.quit();
+ }
+ }
+ }
+ }
+ \endcode
*/
/*!