diff options
author | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2014-07-25 15:27:23 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2014-09-01 13:19:07 +0200 |
commit | d06fb5609c02d639e44e932988f428c13aab71c3 (patch) | |
tree | 977160739d81fec02fda31602a63a682d3ef8d60 /src/plugins/platforms/ios | |
parent | 78ee7597482a2efa06305d659a88122a95a062de (diff) |
iOS: Initialize QScreen properties before setting up root viewcontroller
Change-Id: I5fd899030b0557e9b0d96f2c065c8be5cfadd5de
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 | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm index e876665431..a814c042c7 100644 --- a/src/plugins/platforms/ios/qiosscreen.mm +++ b/src/plugins/platforms/ios/qiosscreen.mm @@ -184,25 +184,6 @@ QIOSScreen::QIOSScreen(UIScreen *screen) , m_uiWindow(0) , m_orientationListener(0) { - for (UIWindow *existingWindow in [[UIApplication sharedApplication] windows]) { - if (existingWindow.screen == m_uiScreen) { - m_uiWindow = [m_uiWindow retain]; - break; - } - } - - if (!m_uiWindow) { - // Create a window and associated view-controller that we can use - m_uiWindow = [[UIWindow alloc] initWithFrame:[m_uiScreen bounds]]; - m_uiWindow.rootViewController = [[[QIOSViewController alloc] initWithQIOSScreen:this] autorelease]; - - // FIXME: Only do once windows are added to the screen, and for any screen - if (screen == [UIScreen mainScreen]) { - m_uiWindow.screen = m_uiScreen; - m_uiWindow.hidden = NO; - } - } - if (screen == [UIScreen mainScreen]) { QString deviceIdentifier = deviceModelIdentifier(); @@ -225,6 +206,25 @@ QIOSScreen::QIOSScreen(UIScreen *screen) m_unscaledDpi = 96; } + for (UIWindow *existingWindow in [[UIApplication sharedApplication] windows]) { + if (existingWindow.screen == m_uiScreen) { + m_uiWindow = [m_uiWindow retain]; + break; + } + } + + if (!m_uiWindow) { + // Create a window and associated view-controller that we can use + m_uiWindow = [[UIWindow alloc] initWithFrame:[m_uiScreen bounds]]; + m_uiWindow.rootViewController = [[[QIOSViewController alloc] initWithQIOSScreen:this] autorelease]; + + // FIXME: Only do once windows are added to the screen, and for any screen + if (screen == [UIScreen mainScreen]) { + m_uiWindow.screen = m_uiScreen; + m_uiWindow.hidden = NO; + } + } + connect(qGuiApp, &QGuiApplication::focusWindowChanged, this, &QIOSScreen::updateStatusBarVisibility); updateProperties(); |