diff options
Diffstat (limited to 'src/plugins/platforms/ios/qiosscreen.mm')
-rw-r--r-- | src/plugins/platforms/ios/qiosscreen.mm | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm index c394592d76..8a9a974825 100644 --- a/src/plugins/platforms/ios/qiosscreen.mm +++ b/src/plugins/platforms/ios/qiosscreen.mm @@ -130,16 +130,14 @@ static QIOSScreen* qtPlatformScreenFor(UIScreen *uiScreen) // ------------------------------------------------------------------------- -@interface QIOSOrientationListener : NSObject { - @public - QIOSScreen *m_screen; -} -- (id)initWithQIOSScreen:(QIOSScreen *)screen; +@interface QIOSOrientationListener : NSObject @end -@implementation QIOSOrientationListener +@implementation QIOSOrientationListener { + QIOSScreen *m_screen; +} -- (id)initWithQIOSScreen:(QIOSScreen *)screen +- (instancetype)initWithQIOSScreen:(QIOSScreen *)screen { self = [super init]; if (self) { @@ -193,7 +191,7 @@ static QIOSScreen* qtPlatformScreenFor(UIScreen *uiScreen) @implementation QUIWindow -- (id)initWithFrame:(CGRect)frame +- (instancetype)initWithFrame:(CGRect)frame { if ((self = [super initWithFrame:frame])) self->_sendingEvent = NO; @@ -392,14 +390,19 @@ void QIOSScreen::deliverUpdateRequests() const QList<QWindow*> windows = QGuiApplication::allWindows(); for (int i = 0; i < windows.size(); ++i) { - if (platformScreenForWindow(windows.at(i)) != this) + QWindow *window = windows.at(i); + if (platformScreenForWindow(window) != this) continue; - QWindowPrivate *wp = static_cast<QWindowPrivate *>(QObjectPrivate::get(windows.at(i))); + QWindowPrivate *wp = qt_window_private(window); if (!wp->updateRequestPending) continue; - wp->deliverUpdateRequest(); + QPlatformWindow *platformWindow = window->handle(); + if (!platformWindow) + continue; + + platformWindow->deliverUpdateRequest(); // Another update request was triggered, keep the display link running if (wp->updateRequestPending) |