diff options
author | André Klitzing <aklitzing@gmail.com> | 2020-09-14 13:46:56 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-09-14 22:25:48 +0000 |
commit | b79b75adf93afa983217f5c7fdd40044909a0ad2 (patch) | |
tree | f312ce43bdedaf4bc13c8d85b210c660fe06415b /src/plugins/platforms/ios/qiosscreen.mm | |
parent | 07044d70e9cd6a547ac9b4c5a462a8dc5ad68c17 (diff) |
Fix -Wunguarded-availability-new for userInterfaceStyle
'userInterfaceStyle' is only available on iOS 12.0 or newer [-Werror,-Wunguarded-availability-new]
if (previousTraitCollection.userInterfaceStyle != self.traitCollection.userInterfaceStyle) {
Pick-to: 5.15
Change-Id: Id6340f70019d55ab2a0707b1aebd6d333e9544cb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms/ios/qiosscreen.mm')
-rw-r--r-- | src/plugins/platforms/ios/qiosscreen.mm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm index 80636ab9c6..411f6ebf81 100644 --- a/src/plugins/platforms/ios/qiosscreen.mm +++ b/src/plugins/platforms/ios/qiosscreen.mm @@ -213,10 +213,12 @@ static QIOSScreen* qtPlatformScreenFor(UIScreen *uiScreen) { [super traitCollectionDidChange:previousTraitCollection]; - if (self.screen == UIScreen.mainScreen) { - if (previousTraitCollection.userInterfaceStyle != self.traitCollection.userInterfaceStyle) { - QIOSTheme::initializeSystemPalette(); - QWindowSystemInterface::handleThemeChange<QWindowSystemInterface::SynchronousDelivery>(nullptr); + if (@available(iOS 12, *)) { + if (self.screen == UIScreen.mainScreen) { + if (previousTraitCollection.userInterfaceStyle != self.traitCollection.userInterfaceStyle) { + QIOSTheme::initializeSystemPalette(); + QWindowSystemInterface::handleThemeChange<QWindowSystemInterface::SynchronousDelivery>(nullptr); + } } } } |