aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2014-09-22 16:04:19 +0200
committerShawn Rutledge <shawn.rutledge@digia.com>2014-09-22 16:09:40 +0200
commit106900b2058036681a9f6efabc4ea6f76c3f5990 (patch)
tree001c34284c4a5194d9e5dcd8778277852809e789 /examples/quick
parent51a2bd8dfa15f52e2b45b3a0cc0135603a374200 (diff)
Window example: setOrientationUpdateMask to allow all orientations
The purpose of showing both orientation and primaryOrientation is to see how they both change when the screen is rotated. Change-Id: I54e51c834c568b1dbd895584b9f80e4b00c8d506 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Diffstat (limited to 'examples/quick')
-rw-r--r--examples/quick/window/main.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/quick/window/main.cpp b/examples/quick/window/main.cpp
index 7872c7183c..953b87e047 100644
--- a/examples/quick/window/main.cpp
+++ b/examples/quick/window/main.cpp
@@ -39,6 +39,7 @@
****************************************************************************/
#include <QtGui/QGuiApplication>
+#include <QtGui/QScreen>
#include <QtQml/QQmlEngine>
#include <QtQml/QQmlComponent>
#include <QtQuick/QQuickWindow>
@@ -48,6 +49,9 @@
int main(int argc, char* argv[])
{
QGuiApplication app(argc, argv);
+ foreach (QScreen * screen, QGuiApplication::screens())
+ screen->setOrientationUpdateMask(Qt::LandscapeOrientation | Qt::PortraitOrientation |
+ Qt::InvertedLandscapeOrientation | Qt::InvertedPortraitOrientation);
QQmlEngine engine;
QQmlComponent component(&engine);
QQuickWindow::setDefaultAlphaBuffer(true);