When I set a background color for a QPushButton at its stylesheet, it loses pressed/clicked effect. How can I fix this? How can I re-add this effect?
Asked
Active
Viewed 4,836 times
3 Answers
2
You can use style sheets to customize the look and feel of a QPushButton. There is a great list of examples here showing off what you can do. Specifically, you'll be looking at the "pressed" state:
QPushButton:pressed {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #dadbde, stop: 1 #f6f7fa);
}

mbroadst
- 768
- 6
- 8
-
AVAST popups and blocks access to the qt-project.org site linked, saying that it's a phishing site. May want to check it to be sure. – Mike from PSG Dec 16 '19 at 18:09
1
I found the solution of my problem. I removed "border" declaration/definition at widget that contains these push buttons. Thus problem is solved.

Oğuzhan Türk
- 360
- 2
- 9
- 21