summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@intopalo.com>2015-06-28 21:31:30 +1000
committerSamuel Nevala <samuel.nevala@intopalo.com>2015-09-10 06:44:57 +0000
commit7293200ace12f4870b87bb6a1f5a22ef53bf52cd (patch)
treedd1e3dfc20cb5ed0822a2ead275e392d99bff1d8 /src/corelib/global
parentaaab800e1651fc9f04d62a76eda9b8cafbbe14c0 (diff)
Add attribute to enable font and palette propagation in QSS.
By default when using Qt Style Sheets, a widget does not inherit its font and palette from its parent widget. With the Qt::AA_UseStyleSheetPropagationInWidgetStyles application attribute set, propagation when using Qt Style Sheets behaves like it does with regular QWidget::setPalette() and QWidget::setFont() calls. [ChangeLog][QtWidgets] Added the Qt::AA_UseStyleSheetPropagationInWidgetStyles attribute which enables font and palette propagation for Qt Style Sheets. Task-number: QTBUG-37580 Change-Id: I3038c13d61e32625a1a05291c5394eaefd376a68 Reviewed-by: Samuel Nevala <samuel.nevala@intopalo.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qnamespace.h1
-rw-r--r--src/corelib/global/qnamespace.qdoc7
2 files changed, 8 insertions, 0 deletions
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index e62b658afc..056e519e56 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -498,6 +498,7 @@ public:
AA_ShareOpenGLContexts = 18,
AA_SetPalette = 19,
AA_NoHighDpiScaling = 20,
+ AA_UseStyleSheetPropagationInWidgetStyles = 21, // ### Qt 6: remove me
// Add new attributes before this line
AA_AttributeCount
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index c7effe0c0c..b7c6500831 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -213,6 +213,13 @@
so this does not guarantee that QPaintDevice::devicePixelRatio() will
be equal to 1. This value has been added in Qt 5.6.
+ \value AA_UseStyleSheetPropagationInWidgetStyles By default, Qt Style Sheets
+ disable regular QWidget palette and font propagation. When this flag
+ is enabled, font and palette changes propagate as though the user had
+ manually called the corresponding QWidget methods. See
+ \l{The Style Sheet Syntax#Inheritance}{The Style Sheet Syntax - Inheritance}
+ for more details. This value has been added in Qt 5.7.
+
The following values are obsolete:
\value AA_ImmediateWidgetCreation This attribute is no longer fully