summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-12-20 19:09:44 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-01-09 02:33:08 +0100
commit7b092b3fe3c9960a2e2866a3b03818fe63bbbac4 (patch)
treecf43bdc93211026dbc5ce6b96e83b2eb55ce012e
parent2a02487ff00341fcc07023b37ec527c2694fa4c1 (diff)
Remove clearWidgetPaletteHash argument from setPalette_helper
The argument is only used when the application palette is set, (as opposed to setting the palette for a specific widget class), and that code path is only triggered from QApplication::setPalette, which passes 'true' for this argument. Change-Id: I67a1cc3741f6f62653b0f95ff88d28228f9977d4 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
-rw-r--r--src/widgets/kernel/qapplication.cpp9
-rw-r--r--src/widgets/kernel/qapplication_p.h2
2 files changed, 5 insertions, 6 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 28575a20f5..ef76265f8b 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -633,7 +633,7 @@ static void setPossiblePalette(const QPalette *palette, const char *className)
{
if (palette == 0)
return;
- QApplicationPrivate::setPalette_helper(*palette, className, false);
+ QApplicationPrivate::setPalette_helper(*palette, className);
}
void QApplicationPrivate::initializeWidgetPaletteHash()
@@ -1363,7 +1363,7 @@ QPalette QApplication::palette(const char *className)
return QGuiApplication::palette();
}
-void QApplicationPrivate::setPalette_helper(const QPalette &palette, const char* className, bool clearWidgetPaletteHash)
+void QApplicationPrivate::setPalette_helper(const QPalette &palette, const char* className)
{
QPalette pal = palette;
@@ -1380,8 +1380,7 @@ void QApplicationPrivate::setPalette_helper(const QPalette &palette, const char*
if (!widgetPalettes.isEmpty()) {
all = true;
- if (clearWidgetPaletteHash)
- widgetPalettes.clear();
+ widgetPalettes.clear();
}
} else {
widgetPalettes.insert(className, pal);
@@ -1416,7 +1415,7 @@ void QApplicationPrivate::setPalette_helper(const QPalette &palette, const char*
void QApplication::setPalette(const QPalette &palette, const char* className)
{
- QApplicationPrivate::setPalette_helper(palette, className, /*clearWidgetPaletteHash=*/ true);
+ QApplicationPrivate::setPalette_helper(palette, className);
}
diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h
index 8751cc772b..71f695cc18 100644
--- a/src/widgets/kernel/qapplication_p.h
+++ b/src/widgets/kernel/qapplication_p.h
@@ -185,7 +185,7 @@ public:
static bool widgetCount; // Coupled with -widgetcount switch
static void setSystemPalette(const QPalette &pal);
- static void setPalette_helper(const QPalette &palette, const char* className, bool clearWidgetPaletteHash);
+ static void setPalette_helper(const QPalette &palette, const char* className);
static void initializeWidgetPaletteHash();
static void initializeWidgetFontHash();
static void setSystemFont(const QFont &font);