From c7ecff04609dd7d9282fa5de3d5d1e1fd189b4cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 19 Dec 2019 12:28:33 +0100 Subject: Simplify QApplication::palette Change-Id: I1f1be554a72a385985eeee0b79b49acdfcf40d8e Reviewed-by: Timur Pocheptsov --- src/widgets/kernel/qapplication.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 9b1202c491..a74b45f377 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -1354,15 +1354,14 @@ QPalette QApplication::palette(const QWidget* w) */ QPalette QApplication::palette(const char *className) { - if (!QApplicationPrivate::app_pal) - palette(); PaletteHash *hash = app_palettes(); if (className && hash && hash->size()) { QHash::ConstIterator it = hash->constFind(className); if (it != hash->constEnd()) return *it; } - return *QApplicationPrivate::app_pal; + + return QGuiApplication::palette(); } void QApplicationPrivate::setPalette_helper(const QPalette &palette, const char* className, bool clearWidgetPaletteHash) -- cgit v1.2.3