summaryrefslogtreecommitdiffstats
path: root/src/widgets/doc/snippets
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/widgets/doc/snippets
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/widgets/doc/snippets')
-rw-r--r--src/widgets/doc/snippets/code/doc_src_stylesheet.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/widgets/doc/snippets/code/doc_src_stylesheet.cpp b/src/widgets/doc/snippets/code/doc_src_stylesheet.cpp
index a937498fe5..01f4c528a2 100644
--- a/src/widgets/doc/snippets/code/doc_src_stylesheet.cpp
+++ b/src/widgets/doc/snippets/code/doc_src_stylesheet.cpp
@@ -138,3 +138,7 @@ emailEdit->setProperty("mandatoryField", true);
QSpinBox *ageSpinBox = new QSpinBox(this);
ageSpinBox->setProperty("mandatoryField", true);
//! [95]
+
+//! [96]
+qApp->setAttribute(Qt::AA_UseStyleSheetPropagationInWidgetStyles, true);
+//! [97]