diff options
Diffstat (limited to 'src/plugins/platforms/ios/qiosviewcontroller.mm')
-rw-r--r-- | src/plugins/platforms/ios/qiosviewcontroller.mm | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/src/plugins/platforms/ios/qiosviewcontroller.mm b/src/plugins/platforms/ios/qiosviewcontroller.mm index aa909d6f63..ce2aa96ca5 100644 --- a/src/plugins/platforms/ios/qiosviewcontroller.mm +++ b/src/plugins/platforms/ios/qiosviewcontroller.mm @@ -57,12 +57,8 @@ // ------------------------------------------------------------------------- -@interface QIOSViewController () { - @public - QPointer<QT_PREPEND_NAMESPACE(QIOSScreen)> m_screen; - BOOL m_updatingProperties; - QMetaObject::Connection m_focusWindowChangeConnection; -} +@interface QIOSViewController () +@property (nonatomic, assign) QPointer<QT_PREPEND_NAMESPACE(QIOSScreen)> platformScreen; @property (nonatomic, assign) BOOL changingOrientation; @end @@ -73,7 +69,7 @@ @implementation QIOSDesktopManagerView -- (id)init +- (instancetype)init { if (!(self = [super init])) return nil; @@ -126,7 +122,7 @@ { Q_UNUSED(subview); - QT_PREPEND_NAMESPACE(QIOSScreen) *screen = self.qtViewController->m_screen; + QT_PREPEND_NAMESPACE(QIOSScreen) *screen = self.qtViewController.platformScreen; // The 'window' property of our view is not valid until the window // has been shown, so we have to access it through the QIOSScreen. @@ -171,7 +167,7 @@ // here. iOS will still use the latest rendered frame to create the // application switcher thumbnail, but it will be based on the last // active orientation of the application. - QIOSScreen *screen = self.qtViewController->m_screen; + QIOSScreen *screen = self.qtViewController.platformScreen; qCDebug(lcQpaWindow) << "ignoring layout of subviews while suspended," << "likely system snapshot of" << screen->screen()->primaryOrientation(); return; @@ -247,7 +243,10 @@ // ------------------------------------------------------------------------- -@implementation QIOSViewController +@implementation QIOSViewController { + BOOL m_updatingProperties; + QMetaObject::Connection m_focusWindowChangeConnection; +} #ifndef Q_OS_TVOS @synthesize prefersStatusBarHidden; @@ -255,11 +254,10 @@ @synthesize preferredStatusBarStyle; #endif -- (id)initWithQIOSScreen:(QT_PREPEND_NAMESPACE(QIOSScreen) *)screen +- (instancetype)initWithQIOSScreen:(QT_PREPEND_NAMESPACE(QIOSScreen) *)screen { if (self = [self init]) { - m_screen = screen; - + self.platformScreen = screen; self.changingOrientation = NO; #ifndef Q_OS_TVOS @@ -333,7 +331,7 @@ - (BOOL)shouldAutorotate { #ifndef Q_OS_TVOS - return m_screen && m_screen->uiScreen() == [UIScreen mainScreen] && !self.lockedOrientation; + return self.platformScreen && self.platformScreen->uiScreen() == [UIScreen mainScreen] && !self.lockedOrientation; #else return NO; #endif @@ -413,8 +411,8 @@ if (!QCoreApplication::instance()) return; - if (m_screen) - m_screen->updateProperties(); + if (self.platformScreen) + self.platformScreen->updateProperties(); } // ------------------------------------------------------------------------- @@ -424,12 +422,12 @@ if (!isQtApplication()) return; - if (!m_screen || !m_screen->screen()) + if (!self.platformScreen || !self.platformScreen->screen()) return; // For now we only care about the main screen, as both the statusbar // visibility and orientation is only appropriate for the main screen. - if (m_screen->uiScreen() != [UIScreen mainScreen]) + if (self.platformScreen->uiScreen() != [UIScreen mainScreen]) return; // Prevent recursion caused by updating the status bar appearance (position @@ -451,7 +449,7 @@ return; // We only care about changes to focusWindow that involves our screen - if (!focusWindow->screen() || focusWindow->screen()->handle() != m_screen) + if (!focusWindow->screen() || focusWindow->screen()->handle() != self.platformScreen) return; // All decisions are based on the the top level window |