Solved Stylesheet QRadiobutton
-
Hi,
I try to change style of my QRadioButton. But when this one is disabled, a new color appears to create a shadow effect, but I don't know how to change or remove this color in qss file.
Someone can help me ?Here, shadow color is white.
-
I found the solution !
just add :
QRadioButton { background: transparent; }
and it works, stange ...
Thanks
-
@OPit
You should show what stylesheet rule you are currently using to affect the radiobutton.
In this case, because of disablement you may need to deal with rule:QRadioButton:!enabled { ... }
. The "shadow effect" is how (Windows?) shows disabled text. -
That's what I've already done :
QRadioButton:disabled { color: #666; }
Thanks
-
@OPit
Can only say: search https://doc.qt.io/qt-5/stylesheet-reference.html. I thought it might betext-decoration
, but seemingly not. There is a mention ofshadow
, if that's what it is.Also see https://forum.qt.io/topic/78123/stylesheet-for-disabled-qpushbutton-under-win-xp/6, I have a feeling
{ etch-disabled-text: 0; }
is supposed to control it but does not work.Otherwise if cannot do it via stylesheet, may have to do it through
QStyle
. -
I found the solution !
just add :
QRadioButton { background: transparent; }
and it works, stange ...
Thanks