Light up a button when the button is clicked
Solved
General and Desktop
-
wrote on 31 May 2017, 19:52 last edited by
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.
-
wrote on 1 Jun 2017, 08:03 last edited by Eddy 6 Jan 2017, 08:03
To add to @SGaist , you can use a stylesheet to make the checked state more visible.
Have a look at the qpushbutton stylesheet example
-
wrote on 6 Jun 2017, 19:54 last edited by
yeah I used the stylesheets and it solved my problem
2/4