PDA

View Full Version : how to get the index of the checked radio button inside a group box?



saman_artorious
28th July 2012, 14:29
let's say we have a group box including a few radio buttons. I need to get the index of the clicked or checked radio button so that
I could use it as a parameter to a function, this simplifies my code, you have any idea if that's possible?
if not I need to waste time checking the ischecked() method with if-else

mvuori
28th July 2012, 17:08
I don't know, but if that is not possible, one thing that might help here is adding the buttons to a QButtonGroup, which has for example buttonClicked(int id) signal just for this.

amleto
28th July 2012, 17:09
no, it is not possible. You are of course free to use QSignalMapper which will solve your problem.