summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorAndré Klitzing <aklitzing@gmail.com>2020-09-14 13:46:56 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-09-14 22:25:48 +0000
commitb79b75adf93afa983217f5c7fdd40044909a0ad2 (patch)
treef312ce43bdedaf4bc13c8d85b210c660fe06415b /src/plugins/platforms
parent07044d70e9cd6a547ac9b4c5a462a8dc5ad68c17 (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')
-rw-r--r--src/plugins/platforms/ios/qiosscreen.mm10
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);
+ }
}
}
}