App is always launched in landscape orientation in N9
-
I am porting a QML app from Symbian to N9. When launched it always defaults to landscape. To my surprise the following properties of Screen component are wrongly returned.
screen.width is:854
screen.displayWidth is:854
screen.orientation is:270The device is properly placed in portrait orientation. Locking orientation of Page (s) to PageOrientation.LockPortrait has no effect.
I am using com.nokia.meego 1.0, QtQuick 1.1 with PageStackWindow.
Any solutions to this problem?Thanks in advance.
Srikanth -
Have a look at "this solved thread":http://developer.qt.nokia.com/forums/viewthread/8546.
-
Using Widget component is not solving my problem. I see that the default is always landscape, as with X window system being landscape. So the values of width, height are being swapped. So any code like
@Text {
width: screen.width; // or screen.displayWidth
}@will go for a toss.
A simple work around would be to rely on anchoring. The above code can be re-told as
@Text {
anchors.fill: parent;
}@But with the above code I am not sure if orientation works as with screen.width property changes.
-
Without seeing the code, it's hard to give any precision-advice.
The easiest way to control the application is to utilize Qt Quick Components.
And doing exactly that is explained in the Harmattan Developer Library (http://harmattan-dev.nokia.com/docs/library/html/guide/html/Developer_Library_Developing_for_Harmattan_Controlling_rotation.html).
Hopefully that information comes in helpful.