How to correctly set push button style when pressed?
-
wrote on 25 Jun 2018, 16:35 last edited by
-
Hello, I'm new to Qt and I'm using Qt Designer.
My Problem is:
I'm unable to set a style to a push button when it is pressed. See the image below:
The stylesheet pressed state has no effect on the button, does anyone see what I am doing wrong?
Thank you for your time, have a good day!
wrote on 25 Jun 2018, 18:35 last edited by@testevpsa Hi,
Maybe your first 4 lines overrides the other definitions because they are global. Try to enclose them in QPushButton{...}
QPushButton { background-color: rgb(51, 153, 204); ... } QPushButton:pressed { background-color: rgb(224, 0, 0); ... }
-
@testevpsa Hi,
Maybe your first 4 lines overrides the other definitions because they are global. Try to enclose them in QPushButton{...}
QPushButton { background-color: rgb(51, 153, 204); ... } QPushButton:pressed { background-color: rgb(224, 0, 0); ... }
-
@testevpsa Hi,
Maybe your first 4 lines overrides the other definitions because they are global. Try to enclose them in QPushButton{...}
QPushButton { background-color: rgb(51, 153, 204); ... } QPushButton:pressed { background-color: rgb(224, 0, 0); ... }
-
@Gojir4 Hi, where did youn find ":pressed"? I tried to search it on the documentation but it doesn't mention about pressed
-