[PyQt] How to read the current value of a QML radio button group

Glenn Ramsey gr at componic.co.nz
Mon Dec 16 02:09:18 GMT 2013


Hi,

I have some QML code that contains some RadioButtons and I want to find out from 
code which button is selected.

The RadioButtons are contained by an ExclusiveGroup. The docs show that 
ExclusiveGroup has a "current" property and that is what I think I need to read. 
However I can't figure out how to access that property.

To get a reference to a QML Item I use:

QQuickView.rootObject().findChild(QQuickItem, <objectName>, <field>)

but this doesn't work for ExclusiveGroup because QQuickExclusiveGroup is not 
wrapped.

Apart from iterating through them by name, how can I determine which RadioButton 
is currently selected?

Glenn




More information about the PyQt mailing list