summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-12-17 20:48:31 +0100
committerTarja Sundqvist <tarja.sundqvist@qt.io>2021-02-08 15:07:34 +0200
commit777805daa6d1a074baae321179157b36288c5457 (patch)
tree96f14b6bf9e2d77111c8aaa619e80949e5317034
parent5d582d9084727f7b07ee53fc534a3263c5fc3ab3 (diff)
Update QPalette() documentation to not mention the application palette
It's an implementation detail that the default constructed palette happens to use the d-pointer of the application palette, and as a result has the same colors as the application palette if requested. The palette has an empty resolve mask, and hence all the colors in the palette are undefined. Users should not rely on QPalette() to represent the application palette when for example overriding a parent palette. Task-number: QTBUG-85226 Pick-to: 6.0 5.15 Change-Id: Ia6747887eef6e9a5f21b2002066608c433260de2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r--src/gui/kernel/qpalette.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp
index 307cf99f0c..6c95359d52 100644
--- a/src/gui/kernel/qpalette.cpp
+++ b/src/gui/kernel/qpalette.cpp
@@ -531,7 +531,10 @@ static void qt_palette_from_color(QPalette &pal, const QColor &button)
*/
/*!
- Constructs a palette object that uses the application's default palette.
+ Constructs an empty palette object with no color roles set.
+
+ When used as the palette of a QWidget the colors are resolved
+ as described by QWidget::setPalette().
\sa QApplication::setPalette(), QApplication::palette()
*/