Le 16/07/2016 à 18:11, Michael Pyne a écrit :

On Sat, July 16, 2016 01:15:38 Olivier Churlaud wrote:
Hi,

I spent a lot of time tonight, trying to port a config dialog out of
KButtonGroup (in Okular). I read that I should instead use QButtonGroup
+ QGroupBox. I did this, and this part works.

The problem I have is that the KConfig-thing doesn't write/read from
this QButtonGroup. And indeed, this is commented in
https://api.kde.org/frameworks/kconfigwidgets/html/kconfigdialogmanager_8cpp
_source.html#l00153.

How should I do to have several radio buttons to select one system
configuration?
I admit that I'm not a KConfig expert, but it looks as if there's specific
code to look at QGroupBoxes that contain radio buttons (at line 214), and line
105 contains the code to have KConfigDialogManager look at QGroupBoxes when
considering types to look at within the dialog box.

So it seems to me that what you're trying to do should work, as long as the
QGroupBox that holds the radio buttons has the normal requirements met (starts
with kcfg_, etc.).

Thx, I figured out yesterday: The radio buttons must be directly  in the
QGroupBox, which means: no layouts, no other things (labels, icons,...)
in it. Then it's just perfect.

The patch was committed and works as expected.
Thx for your answer

Cheers
Olivier
Regards,
  - Michael Pyne


Reply via email to