[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: KConfigXT: Using a QButtonGroup to represent a bool
From:       Anne-Marie Mahfouf <annemarie.mahfouf () free ! fr>
Date:       2004-10-06 1:54:06
Message-ID: 200410052154.06448.annemarie.mahfouf () free ! fr
[Download RAW message or body]

On 5 October 2004 21:07, Henrique Pinto wrote:
> Hi!
>
> I'm converting an app to KConfigXT, but I'm having a little problem. One of
> the options is a bool, and I'd like to represent that option in the config
> dialog as a QButtonGroup containing two radio buttons (as that would make
> the meaning of the option clearer). Is it possible to do this?
>
> Thank you!
yes, use Enum as type
For example
<entry name="Theme" type="Enum">
      <label>Select the theme you want</label>
      <choices>
        <choice name="colors"/>
        <choice name="house"/>
      </choices>
      <default>colors</default>
    </entry>
where your QButtonGroup is named kcfg_Theme.
The radiobuttons are not named kcfg though.

In the code it's used like that:
if ( KardSettings::theme() == KardSettings::EnumTheme::colors)
for example
(from Kard in kdenonbeta)

Hope it helps,

Anne-Marie
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic