https://bugs.kde.org/show_bug.cgi?id=366418

            Bug ID: 366418
           Summary: Config entries of type "Enum" do not work with
                    "property alias cfg_entryName: comboBox.currentIndex"
           Product: frameworks-plasma
           Version: 5.24.0
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: libplasmaquick
          Assignee: notm...@gmail.com
          Reporter: kosse...@kde.org

When using a config entry of type Enum, e.g. like this:
--- 8< --- main.xml
<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0";
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
      xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
      http://www.kde.org/standards/kcfg/1.0/kcfg.xsd"; >
  <kcfgfile name=""/>

  <group name="General">
    <entry name="projection" type="Enum">
        <choices>
          <choice name="Equirectangular" />
          <choice name="Mercator" />
        </choices>
        <default>Equirectangular</default>
    </entry>
  </group>

</kcfg>
--- 8< --- main.xml
then using an alias property binding like the following does not work:
--- 8< --- config.qml
    // [...]
    property alias cfg_projection: projectionComboBox.currentIndex
    // [...]
        QtControls.ComboBox {
            id: projectionComboBox
            model: [
                i18n("Equirectangular"),
                i18n("Mercator")
            ]
        }
    // [...]
--- 8< --- config.qml
Which would be nice to have, as that alias-binding just works nicely for config
entries of type "int". 

Even more, as the following work-around does work, and just seems the explicit
version of the alias:
--- 8< --- config.qml
    // [...]
    property int cfg_projection: plasmoid.configuration.projection
    // [...]
        QtControls.ComboBox {
            id: projectionComboBox
            model: [
                i18n("Equirectangular"),
                i18n("Mercator")
            ]
            onCurrentIndexChanged: {
                cfg_projection = currentIndex;
            }
            Component.onCompleted: {
                currentIndex = plasmoid.configuration.projection;
            }
        }
    // [...]
--- 8< --- config.qml


Reproducible: Always

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to