[Qt-interest] QDataWidgetMapper and QRadioButton
Andre Somers
andre at familiesomers.nl
Tue Jun 22 10:19:34 CEST 2010
Op 22-6-2010 9:59, Manuel Schölling schreef:
> Hi,
>
> I'm looking for a nice way to bind QRadioButton to a QDataWidgetMapper.
> Is there any way to solve this without implementing a new subclass
> QDataWidgetMapper.
> I've been searching the web for several days now but it seems there is
> no standard way in Qt for this (actually very common) problem.
>
> Any ideas are welcome!
>
Good question.
What you could perhaps do, is to create your own widget that groups the
radio buttons (perhaps a QGroupBox derived class?), and that
encapsulates a QButtonGroup. If you give it a property to read/write a
single value that represents/sets which button is currently selected,
you should be able to use that with a QDataWidgetMapper. You can not use
a QButtonGroup directly, as it is not a QWidget.
I did not try that myself.
André
More information about the Qt-interest-old
mailing list