Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Display portrait qml application in landscape

From Wiki
Jump to: navigation, search
Article Metadata
Created: paazmaya (03 Feb 2011)
Last edited: hamishwillee (11 Oct 2012)

Quite often an application is designed and build in a portrait mode and while the device used for testing it might be N900, the result is not what expected. The application is visible only half of the screen and literally in portrait.

To accommodate this, you can consider using the following snippet as a wrapper for the application and in this way still keep building it as portrait, but to be able to test it for example in N900.


* QML Application sizing and rotation as per N900

import QtQuick 1.0 // Qt 4.7.1 and up, N900 with qt quick compatibility package
import Qt 4.7 // Qt 4.7.0
Rectangle {
id: runner
width: 800
height: 480
// Container element for rotating
Item {
height: 800
width: 480
transformOrigin: Item.TopLeft
y: width
rotation: -90
// Add the main QML element here...
MyApp {

QML with Qt

QmlApplicationViewer viewer;
// force lock for portrait mode
This page was last modified on 11 October 2012, at 01:20.
69 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.