Add nullptr check for theme when initializing palette
Change-Id: Iaac2c92f5f7e7fd5c25d6ecde058d4dc01c62aa1 Reviewed-by: Andy Nichols <andy.nichols@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 56e2e899555c99d4013fdbef940a79de9dc542ea) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
9fd2cb559c
commit
c17a16f468
@ -344,8 +344,10 @@ QPlatformThemePrivate::~QPlatformThemePrivate()
|
|||||||
|
|
||||||
Q_GUI_EXPORT QPalette qt_fusionPalette()
|
Q_GUI_EXPORT QPalette qt_fusionPalette()
|
||||||
{
|
{
|
||||||
const bool darkAppearance = QGuiApplicationPrivate::platformTheme()->appearance()
|
auto theme = QGuiApplicationPrivate::platformTheme();
|
||||||
== QPlatformTheme::Appearance::Dark;
|
const bool darkAppearance = theme
|
||||||
|
? theme->appearance() == QPlatformTheme::Appearance::Dark
|
||||||
|
: false;
|
||||||
const QColor windowText = darkAppearance ? QColor(240, 240, 240) : Qt::black;
|
const QColor windowText = darkAppearance ? QColor(240, 240, 240) : Qt::black;
|
||||||
const QColor backGround = darkAppearance ? QColor(50, 50, 50) : QColor(239, 239, 239);
|
const QColor backGround = darkAppearance ? QColor(50, 50, 50) : QColor(239, 239, 239);
|
||||||
const QColor light = backGround.lighter(150);
|
const QColor light = backGround.lighter(150);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user