Can't change font-style or font-weight for anything other than QPushButton using style sheets?
-
Hi, I have been trying to implement
:hoverand:checkedstate 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
colorappears for all widgets but the change infont-styleonly 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: redwould not appear for all the widgets. And what I have shown in my question is the entire stylesheet that I am applying.