Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QML screen orientation lock

I need to lock the screen to a specific orientation for an android app that I'm making. is there a way to do that in QML? Google didn't get me any answers.
I am using Qt 5.2.

like image 262
Abdullah Al-Hatem Avatar asked Dec 25 '13 15:12

Abdullah Al-Hatem


1 Answers

You can basically use the Screen.orientation property for reading only. See the following example for details:

http://qt-project.org/doc/qt-5/qtquick-window-screeninfo-qml.html

The proper way as of today is to use the Android manifest file for this as done by the Qt Android developer at Digia for his QtHangMan game which is:

<activity android:screenOrientation="portrait" ... 
like image 130
lpapp Avatar answered Sep 18 '22 05:09

lpapp