Solved Check QPushButton Color.
-
Is there a way, when a button is clicked, to switch between to color gradients?
For example, when I click on transmitter 1 it will change to color of transmitter 5 and vise versa when I click it again.
-
This is probably best handled with style sheets by adding a
:checked
state customization (like the:pressed
state here). Also, you have to make the buttons checkable. https://doc.qt.io/qt-5/stylesheet-examples.html#style-sheet-usage -
yes. Change its stylesheet.
-
I didn't realize I had to make it checkable. I also added the :checked state. Thanks everyone, that worked.