PDA

View Full Version : how to make one button to do two functions



Shien
2nd January 2011, 21:05
I have 2 push buttons. after clicking one buttons changes to setHidden(true) and and after clicking anoter setHidden(false).

But I do now that it is possible to do that only with one button just like play/pause button?

tbscope
2nd January 2011, 21:18
You need to have a variable that keeps the current state of the button.

Suggestion:
A QPushButton subclass that defines a state variable in the private section.
You can then create a statechanged signal.