From 67739448fb3d9546d19370227e83e2af6795dc6f Mon Sep 17 00:00:00 2001 From: Doris Verria Date: Mon, 3 Jul 2023 11:24:57 +0200 Subject: [PATCH] iOS: Add version check when setting accent color UIColor.tintColor is only available on iOS 15.0 or newer. Ammends commit 69cc7f946a66527c3f2b7a28510dcb37459dc33a Fixes: QTBUG-116840 Change-Id: Id82006629ee3c3d2548ea39afde265cdccf2cdab Reviewed-by: Timur Pocheptsov (cherry picked from commit 00bdf56b83e5959e8a4e9924ba9edf533f4c58ab) Reviewed-by: Volker Hilsheimer --- src/plugins/platforms/ios/qiostheme.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/ios/qiostheme.mm b/src/plugins/platforms/ios/qiostheme.mm index 1572077e281..4126ce8d1e4 100644 --- a/src/plugins/platforms/ios/qiostheme.mm +++ b/src/plugins/platforms/ios/qiostheme.mm @@ -70,7 +70,8 @@ void QIOSTheme::initializeSystemPalette() s_systemPalette.setBrush(QPalette::Highlight, QColor(11, 70, 150, 60)); s_systemPalette.setBrush(QPalette::HighlightedText, qt_mac_toQBrush(UIColor.labelColor.CGColor)); - s_systemPalette.setBrush(QPalette::Accent, qt_mac_toQBrush(UIColor.tintColor.CGColor)); + if (@available(ios 15.0, *)) + s_systemPalette.setBrush(QPalette::Accent, qt_mac_toQBrush(UIColor.tintColor.CGColor)); } const QPalette *QIOSTheme::palette(QPlatformTheme::Palette type) const