summaryrefslogtreecommitdiffstats
path: root/tests/baseline/stylesheet/qss/qheaderview/selectedFontWeight.qss
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2024-04-10 15:25:59 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2024-04-11 04:35:22 +0200
commit74e0ed217fdec8e32227f9f845eccac7f1552297 (patch)
treeb7c6afc3a3778d7d150d19ea4efd3e5c55b6d797 /tests/baseline/stylesheet/qss/qheaderview/selectedFontWeight.qss
parent19b38ede7804e23a1abe7ddabb447c7f5a907a7c (diff)
StyleSheet: respect a font weight set for header sections
QCommonStyle sets the font for a selected header section to bold. This overrides the font weight a calling style might already have set, e.g. when a style sheet is applied to explicitly set a weight for a checked header section: QHeaderView::section:checked { font-size: 20px font-weight: normal } Since setting the weight on a font sets the respective resolve-mask bit, we can avoid overwriting a weight that is already set explicitly. Add baseline test coverage using a QTableWidget. Fixes: QTBUG-122180 Pick-to: 6.7 6.5 Change-Id: I8c6279ad2fd8c5718ebea26e27c64ae823625748 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Diffstat (limited to 'tests/baseline/stylesheet/qss/qheaderview/selectedFontWeight.qss')
-rw-r--r--tests/baseline/stylesheet/qss/qheaderview/selectedFontWeight.qss16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/baseline/stylesheet/qss/qheaderview/selectedFontWeight.qss b/tests/baseline/stylesheet/qss/qheaderview/selectedFontWeight.qss
new file mode 100644
index 0000000000..1c45a99767
--- /dev/null
+++ b/tests/baseline/stylesheet/qss/qheaderview/selectedFontWeight.qss
@@ -0,0 +1,16 @@
+QHeaderView::section {
+ background-color: red;
+ font-size: 10px;
+}
+
+QHeaderView::section:checked {
+ background-color: green;
+ font-size: 20px;
+ font-weight: bold;
+}
+
+QHeaderView::section:first {
+ background-color: yellow;
+ font-size: 20px;
+ font-weight: normal;
+}