Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

How to fix screen orientation to landscape in Quick 2 ?

$
0
0
Hi all, I have written a simple QML game and it runs on my Nexus 7 (API 14). The game is designed to play in landscape mode and I want to fix it. That means if I rotate my Nexus the screen should also stay in landscape. The user has only the chance to play in landscape. I’m using Qt SDK 5.2 with Creator 3.0 on Windows. It sounds strange but I cannot find somewhere information how I can fix the orientation. A lot of threads about reading the “Screen”, “Sensors” I found. But no solution. Most threads are based on older versions Qt 4.7.x and Creator < 3.0. In earlier versions of Creator you could enter the screen orientation with the AppWizard. Then a “qmlapplication class” was generated with a method called setOrientation() which simple sets QDeclarativeView::setAttribute(Qt::WA_LockLandscapeOrientation, true). But this is only available in Quick 1. I use Quick 2!!!!! Have anybody a simple solution? I don’t think for that simple function I have to read sensor and so on. Come on! Thanks a lot.

Viewing all articles
Browse latest Browse all 4972

Trending Articles