Question about setting Push button background color
-
wrote on 29 Jul 2022, 10:03 last edited by dalishi
-
-
wrote on 29 Jul 2022, 15:38 last edited by JoeCFD
@dalishi said in Question about setting Push button background color:
setStyleSheet("QPushButton { background-color : blue }");
Not sure about your question. The setting seems OK. What is the color on your machine when the button is not pressed?
On my machine, the color is same as yours. It becomes a bit darker when the button is pressed. -
Hi
The part of the code that draws the frame/border doesn't use the background color for the background.
the trick is to remove the border and then it showsQPushButton { border: none; background-color : blue; }
-
@dalishi said in Question about setting Push button background color:
setStyleSheet("QPushButton { background-color : blue }");
Not sure about your question. The setting seems OK. What is the color on your machine when the button is not pressed?
On my machine, the color is same as yours. It becomes a bit darker when the button is pressed.
2/5