Can't change font-style or font-weight for anything other than QPushButton using style sheets?
Unsolved
General and Desktop
-
Hi, I have been trying to implement
:hover
and:checked
state for different widgets using Style Sheets:QPushButton:hover, QPushButton:checked{color: red; font-style: oblique}; QCheckBox:hover, QCheckBox:checked{color: red; font-style: oblique}; QRadioButton:hover, QRadioButton:checked{color: red; font-style: oblique}; QSpinBox:hover{color: red; font-style: oblique}; QLineEdit:hover{color: red; font-style: oblique};
The change in
color
appears for all widgets but the change infont-style
only appears forQPushButton
, why? -
-
When only parts of an stylesheet get applied the reason can be, that there is an error in the stylesheet. Then only the top part will be parsed and it stops parsing at the line where the error is. Can you first check if the stylesheet itself is valid?
-
@gde23 Yes, I think it is valid because if it would not be then the change in
color: red
would not appear for all the widgets. And what I have shown in my question is the entire stylesheet that I am applying.