From 5f753c4e86244ac1f8229316cc286d61813fb49f Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Mon, 30 Sep 2013 09:10:20 +0200 Subject: Add example for Switching Between Portrait and Landscape Views MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ife9dbcb5c672e76e721d26ee04ca049842b3f732 Reviewed-by: Topi Reiniƶ --- src/doc/src/b2qt.qdoc | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'src/doc/src') 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 /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 */ /*! -- cgit v1.2.3