change disabled background color QCheckbox?
-
wrote on 11 Nov 2019, 07:55 last edited by
Hi
Is it possible to change the standard gray-ish background color of a
QCheckBox::setEnabled(0)?
I tried to set the background via:
QCheckbox::setStyleSheet("QCheckBox::indicator {background-color:red;}");
but that fills the whole checkbox with that color including the border and the checkmark itself.
-
Hi
Is it possible to change the standard gray-ish background color of a
QCheckBox::setEnabled(0)?
I tried to set the background via:
QCheckbox::setStyleSheet("QCheckBox::indicator {background-color:red;}");
but that fills the whole checkbox with that color including the border and the checkmark itself.
hi @pauledd
haven't checked it, but using the
disabled
keyword should work as a selector:QCheckBox::indicator:disabled{...}
or simply
QCheckBox:disabled {...}
-
wrote on 11 Nov 2019, 08:27 last edited by
-
Thanks, with
QCheckBox:disabled {background-color:red;}
I get this:
and withQCheckBox:disabled {color:green;background-color:red;}
this:
still weird looking but I can live with that...
Thank you.wrote on 11 Nov 2019, 08:31 last edited by JonB 11 Nov 2019, 08:41@pauledd
You mean the background color "overspill" to right & bottom? I don't know but you might play withborder-...
orpadding-...
(I'm thinkingmargin-
does not use background color, but I might be wrong) having a width/transparency/grey....
1/4