Solved Light up a button when the button is clicked
-
Hi, I am trying to control some pins on arduino using QT gui. My requirement is to have one button for each pin. In order to turn on the pin, I click the button and the button should light up and stay pressed, and when i click the button again it should be back to its default state, that is, no light and it should be released.
Is there a way to do this? Can anyone please guide me through the steps that I will need to follow? -
Hi,
Sounds like a QPushButton with the checkable property set to true.
-
To add to @SGaist , you can use a stylesheet to make the checked state more visible.
Have a look at the qpushbutton stylesheet example
-
yeah I used the stylesheets and it solved my problem