Slots and Signals
-
Hi and welcome to the forums
Each button sends the signal clicked(). (amount others)
That signal can be connected to a slot. One slot for each button or
all buttons to the same slot.What do you mean by
- How can I switch between two buttons with the third one?
What should happen when you click the third one?
Im not sure what the switching part means. -
Hi and welcome to devnet,
Do you mean QPushButton one and two are toggle buttons and you want to switch their state with QPushButton three ?
-
Hi and welcome to devnet,
Do you mean QPushButton one and two are toggle buttons and you want to switch their state with QPushButton three ?
-
Then connect your third button to a slot where you do that. To know which button to toggle, use a variable that stores the last modified button. Then change each time based one that.
-
I started learning qt 4.8, but I just can’t figure out the signals and slots. How can I switch between two buttons with the third one?