Re: radiobutton output file
Check who sent the signal using source() and then act accordingly.
Re: radiobutton output file
Check where and what? Im not sure I understand what you mean.
Re: radiobutton output file
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.
Re: radiobutton output file
Quote:
Originally Posted by
nitriles
Check where and what? Im not sure I understand what you mean.
Sorry, should be sender() :) Check inside the slot. sender() returns a pointer to the object that sent the signal.
Re: radiobutton output file
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!