How to press a button, keep it pressed and when I press it the 2nd time to be unpressed
-
I don't know how to search it in google. So, I need to make an small button, with an icon on it. When I press the button it should give me a flag = 1 so that I will be able to run qrubberband. When I choose an area with rqrubberband I need to press again the icon button in order to be able to activate it next time I press it. I mean, while I press it to be kept pressed and when I press it again to be in its initial state.
-
I don't know how to search it in google. So, I need to make an small button, with an icon on it. When I press the button it should give me a flag = 1 so that I will be able to run qrubberband. When I choose an area with rqrubberband I need to press again the icon button in order to be able to activate it next time I press it. I mean, while I press it to be kept pressed and when I press it again to be in its initial state.
@john_hobbyist
you can take a standard QPushButton and set the checkable property to true
https://doc.qt.io/qt-5/qabstractbutton.html#checkable-propthan you get the toggled signal, when the user toggles the button :D
https://doc.qt.io/qt-5/qabstractbutton.html#checked-prop -
This post is deleted!