This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Enum in KConfigGroup

Tags: kconfig, enum, kconfigdialog kconfig, enum, kconfigdialog kconfig, enum, kconfigdialog
(comma "," separated)
icwiener
Moderator
Posts
50
Karma
0
OS

Enum in KConfigGroup

Sun Feb 14, 2016 1:37 am
Hi,

I have a little problem with KConfigDialog. The Settings::bgType() method always returns 0.

But from the beginning. The relevant UI code looks like this (layout code removed):
Code: Select all
<widget class="QGroupBox" name="kcfg_BgType">
    <widget class="QRadioButton" name="theme">
        <property name="text">
            <string>Theme</string>
        </property>
    </widget>
    <widget class="QRadioButton" name="color">
        <property name="text">
            <string>Color</string>
        </property>
    </widget>
    <widget class="QRadioButton" name="image">
        <property name="text">
            <string>Image</string>
        </property>
    </widget>
</widget>


The relevant KCFG code looks like this:
Code: Select all
<group name="Background">
    <entry name="BgType" type="Enum" key="Background Type">
        <label>The background type to be used.</label>
        <choices>
            <choice name="theme"/>
            <choice name="color"/>
            <choice name="image"/>
        </choices>
        <default>theme</default>
    </entry>
</group>


The KCFGC file is:
Code: Select all
File=klickety.kcfg
ClassName=Settings
Singleton=true
Mutators=true
DefaultValueGetters=Theme


With this, the resulting Settings::bgType() returns 0 when Applying the settings in the dialog regardless of what is seleted in the dialog.

Does anyone have any idea what to look for to get to the ground of an issue like that?

Thanks you for any help.

Regards,
Frederik


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]