PDA

View Full Version : How to access QGroupBox members?



gren15
20th March 2009, 16:03
I have a number of radio buttons inside a QGroupBox.
It looks something like this

--GroupBox----------------
| 0 - Radio Button 1 |
| 0 - Radio Button 2 |
| 0 - Radio Button 3 |
| 0 - Radio Button 4 |
| 0 - Radio Button 5 |
--------------------------
The radio buttons choices are exclusive, i.e. only one radio button can be selected at any given time.

I would like to know whether, from the QGroupBox, I can retrieve which radio button has been selected (index).
Rather then checking each radio button to see whether it has been checked or not.

Any suggestions or pointers will be appreciated.
Thanks

Lykurg
20th March 2009, 16:49
Hi,

have a look at QButtonGroup. That's what you are looking for.

Lykurg

gren15
20th March 2009, 17:08
Thanks Lykurg.