CSS + QTableView/QHeaderView: font-weight ignored?
-
wrote on 4 Jul 2016, 08:18 last edited by the_ 7 Apr 2016, 08:23
Hi all,
As the title says...
When selecting a table row the default behaviour is to set the vertical and horizontal header(s) to bold.My attempt was to force the font to be "normal" weight, but that did not work, but other properties could be set without problems using css.
Example:
QHeaderView::section:checked {font: 19px; color:blue;} QHeaderView::section {font: 19px; color:green;}
works as expected and sets the text color to blue when clicking a row, green if not.
Trying with
QHeaderView::section:checked {font: normal 19px; color:blue;} QHeaderView::section {font: 19px; color:green;}
-
Hi all,
As the title says...
When selecting a table row the default behaviour is to set the vertical and horizontal header(s) to bold.My attempt was to force the font to be "normal" weight, but that did not work, but other properties could be set without problems using css.
Example:
QHeaderView::section:checked {font: 19px; color:blue;} QHeaderView::section {font: 19px; color:green;}
works as expected and sets the text color to blue when clicking a row, green if not.
Trying with
QHeaderView::section:checked {font: normal 19px; color:blue;} QHeaderView::section {font: 19px; color:green;}
does the same...
Any ideas what I did wrong?@the_ said:
Any ideas what I did wrong?
probably nothing. Some stuff is simply overwritten by the QStyle implementation.
i can't tell you for sure that this is the case here. Would have to step through QStyle methods to see what happens with the font during painting. -
@the_ said:
Any ideas what I did wrong?
probably nothing. Some stuff is simply overwritten by the QStyle implementation.
i can't tell you for sure that this is the case here. Would have to step through QStyle methods to see what happens with the font during painting.wrote on 4 Jul 2016, 09:46 last edited by the_ 7 Apr 2016, 09:47@raven-worx
Hi,thanks for your reply and information.
Will mark it as "solved", as it is only a minor but interesting styling "issue" :)
1/3