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>bb10
parent
70774d021a
commit
d665ba2a94
|
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue