summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qfusionstyle_p_p.h
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>2013-02-21 13:44:01 +0100
committerTor Arne Vestbø <tor.arne.vestbo@digia.com>2013-02-27 23:56:12 +0100
commit9b05f675e311d1962f0670193cf4df75a07f4999 (patch)
tree1b7e95bdf142da42a5d9fea6068a46c78055eddd /src/widgets/styles/qfusionstyle_p_p.h
parent75a7dc7a574e0c949214feecc711e385f38060e9 (diff)
QFusionStyle: Fix crash on iOS
First of all, the ifdef section was meant for osx, and not ios. Second, a platform theme does not necessarily need to override the palette function, which will return 0 by default. Change-Id: I5a28f4ee1020c9253d0803c9d962c6a058e5358c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'src/widgets/styles/qfusionstyle_p_p.h')
-rw-r--r--src/widgets/styles/qfusionstyle_p_p.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/styles/qfusionstyle_p_p.h b/src/widgets/styles/qfusionstyle_p_p.h
index d3f2ff5f40..58595fe889 100644
--- a/src/widgets/styles/qfusionstyle_p_p.h
+++ b/src/widgets/styles/qfusionstyle_p_p.h
@@ -88,9 +88,9 @@ public:
// On mac we want a standard blue color used when the system palette is used
bool isMacSystemPalette(const QPalette &pal) const {
Q_UNUSED(pal);
-#ifdef Q_OS_MAC
+#if defined(Q_OS_MAC) && !defined(Q_OS_IOS)
const QPalette *themePalette = QGuiApplicationPrivate::platformTheme()->palette();
- if (themePalette->color(QPalette::Normal, QPalette::Highlight) ==
+ if (themePalette && themePalette->color(QPalette::Normal, QPalette::Highlight) ==
pal.color(QPalette::Normal, QPalette::Highlight) &&
themePalette->color(QPalette::Normal, QPalette::HighlightedText) ==
pal.color(QPalette::Normal, QPalette::HighlightedText))