Unsolved Slots and Signals
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?
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.
when I click on the third button, the first one is pressed then the second.I meant it
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 ?
This post is deleted!
@SGaist I 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.
out of curiosity why do you learn qt4 and not qt5.
the last version of qt4 was released 2011, It is quite outdated by todays standards.