PDA

View Full Version : Iterating over QGroupBox



Doug Broadwell
26th February 2007, 18:25
I have a QGroupBox containing several QRadioButtons. How do I iterate over this group to get the QRadioButtons' "objectName" and "checked" value?

Thanks

jacek
26th February 2007, 19:08
Use QObject::children().

jpn
26th February 2007, 19:09
The easiest way is to simply store pointers as member variables. However, you can use QObject::findChildren() or QLayout::itemAt() to access to the radio buttons still no pointers were stored. Yet another approach could be to make use of QButtonGroup or QSignalMapper to distinguish between the radio buttons.

Doug Broadwell
26th February 2007, 22:13
Thank you.