summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorAxel Spoerl <axel.spoerl@qt.io>2024-03-14 08:48:56 +0100
committerAxel Spoerl <axel.spoerl@qt.io>2024-03-18 14:19:00 +0000
commitf2b681dc590c7fd3cd19cbde20363339ceae15f8 (patch)
treee3a269417de0d0429ce8eab031162368649d5865 /src/widgets
parent6c0be8acc44df9eec2c64527696bb137650124ba (diff)
Documentation: Clarify palette/font/stylesheet inheritance/propagation
Palette and font changes made by a style sheet are propagated to existing widgets and their children at change time. Palette and font changes made by setPalette() and setFont() are inherited by all existing and future children of the widget to which the call was made. Clarify this in the documentation. Fixes: QTBUG-122588 Pick-to: 6.7 6.6 6.5 6.2 5.15 Change-Id: Ic40d96fc1e5e4507f84a33138303b7193948d3fe Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc b/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc
index f4c9eb2cc3..05000024e1 100644
--- a/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc
+++ b/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc
@@ -480,11 +480,20 @@
\snippet code/doc_src_stylesheet.cpp 96
When the widget-style font and palette propagation is enabled, font and
- palette changes made through Qt Style Sheets will behave as though the
- user had manually called the corresponding QWidget::setPalette() and
+ palette changes made through Qt Style Sheets will behave as if the user
+ had manually called the corresponding QWidget::setPalette() and
QWidget::setFont() methods on all of the QWidgets targeted by the style
- sheet. If this would have caused propagation in C++, it will cause
- propagation in style sheets and vice versa.
+ sheet.
+
+ \list
+ \li Changes made by a style sheet are propagated.
+ They are pushed to all widgets matching the style sheet once, at the time
+ the change is made.
+ \li Changes made by calling QWidget::setPalette() or QWidget::setFont() are
+ inherited.
+ They are inherited by all existing and future children, where the respective
+ brush or font hasn't been explicitly set.
+ \endlist
\section1 Widgets Inside C++ Namespaces