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>
This commit is contained in:
André Klitzing 2020-09-14 13:46:56 +02:00 committed by Tor Arne Vestbø
parent 07044d70e9
commit b79b75adf9

View File

@ -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);
}
}
}
}