Check where and what? Im not sure I understand what you mean.
Check where and what? Im not sure I understand what you mean.
Add your tow radio buttons to a QButtonGroup and set their id's to 1 and 2, for example.
Now, when one of these buttons is clicked, the button group will emit the buttonClicked(int id) signal. The id will be 1 or 2, depending on which button was clicked.
You should connect the buttonClicked signal somewhere in your class and set a flag, for instance a boolean flag isCd, which can be true or false. Next, when you press the push button, you should look at isCd and print "cd" if it is true and "dvd" otherwise.
Another solution is to connect the clicked() signal of the pushbutton to s slot, and in that slot check the two radio buttons to see which one is checked. You can do this with QRadioButton::isChecked(). I think this one is easier.
nitriles (20th September 2007)
Thanks a lot to both!
Marcel thanks for explaining it in a user friendly language lol.
I finally managed to make it, its part of a bigger program and this was only a small example, but now atleast i can implement it.
THANKS!
Bookmarks