summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformtheme.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qplatformtheme.cpp')
-rw-r--r--src/gui/kernel/qplatformtheme.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp
index fe044bd1be..8e8d7b3be5 100644
--- a/src/gui/kernel/qplatformtheme.cpp
+++ b/src/gui/kernel/qplatformtheme.cpp
@@ -344,8 +344,10 @@ QPlatformThemePrivate::~QPlatformThemePrivate()
Q_GUI_EXPORT QPalette qt_fusionPalette()
{
- const bool darkAppearance = QGuiApplicationPrivate::platformTheme()->appearance()
- == QPlatformTheme::Appearance::Dark;
+ auto theme = QGuiApplicationPrivate::platformTheme();
+ const bool darkAppearance = theme
+ ? theme->appearance() == QPlatformTheme::Appearance::Dark
+ : false;
const QColor windowText = darkAppearance ? QColor(240, 240, 240) : Qt::black;
const QColor backGround = darkAppearance ? QColor(50, 50, 50) : QColor(239, 239, 239);
const QColor light = backGround.lighter(150);