diff options
author | Richard Moe Gustavsen <richard.gustavsen@digia.com> | 2012-12-17 13:39:59 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2013-02-27 23:55:55 +0100 |
commit | d665ba2a9454dbd2ed9f4384e04c31d232b0c5eb (patch) | |
tree | bb8d8533fbde07b16987180aa24c2779d6cb29fb /src/plugins/platforms/ios | |
parent | 70774d021a4ddb6437646ab09bde0928e30c8a90 (diff) |
iOS: let QIOSScreen use correct orientation at startup
When QScreen is created, we need to check if the application
is already in landscape.
Change-Id: I653c622154a5c23ec93e89ec3e80fefb6b1f1bdd
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Diffstat (limited to 'src/plugins/platforms/ios')
-rw-r--r-- | src/plugins/platforms/ios/qiosscreen.mm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm index 02d719eaf1..a2fd10bdd4 100644 --- a/src/plugins/platforms/ios/qiosscreen.mm +++ b/src/plugins/platforms/ios/qiosscreen.mm @@ -42,6 +42,7 @@ #include "qiosscreen.h" #include "qioswindow.h" #include <qpa/qwindowsysteminterface.h> +#include "qiosapplicationdelegate.h" #include <sys/sysctl.h> @@ -185,6 +186,12 @@ QIOSScreen::QIOSScreen(unsigned int screenIndex) const qreal millimetersPerInch = 25.4; m_physicalSize = QSizeF(m_geometry.size()) / unscaledDpi * millimetersPerInch; + if ([[UIApplication sharedApplication].delegate isKindOfClass:[QIOSApplicationDelegate class]]) { + // When in a non-mixed environment, let QScreen follow the current interface orientation: + UIViewController *controller = [UIApplication sharedApplication].delegate.window.rootViewController; + setPrimaryOrientation(toQtScreenOrientation(controller.interfaceOrientation)); + } + [pool release]; } |