我正在为 KDE Plasma 开发壁纸插件。我已经对所有效果进行了编码并对其进行了测试。它运行良好。但是在对配置文件进行编码时,配置根本没有出现在配置壁纸中。当我选择另一个插件时,它会出现,当我再次选择这个时,配置不会加载。这是代码。
import QtQuick 2.1
import QtQuick.Layouts 1.0
import QtQuick.Controls 1.0 as QtControls
// for "units"
import org.kde.plasma.core 2.0 as PlasmaCore
ColumnLayout {
id: root
property alias cfg_DisplayText: textField.text
RowLayout {
spacing: units.largeSpacing / 2
// To allow aligned integration in the settings form,
// "formAlignment" is a property injected by the config containment
// which defines the offset of the value fields
QtControls.Label {
Layout.minimumWidth: width
Layout.maximumWidth: width
width: formAlignment - units.largeSpacing
horizontalAlignment: Text.AlignRight
// use i18nd in config QML, as the default textdomain is set to that of the config container
text: i18nd("plasma_wallpaper_org.kde.plasma.random", "Choose Effect")
}
QtControls.ComboBox {
id: resizeComboBox
Kirigami.FormData.label: i18ndc("plasma_wallpaper_org.kde.plasma.random", "@label:listbox", "Centre Logo Glow:")
model: [
{
'label': i18ndc("plasma_wallpaper_org.kde.plasma.random", "@item:inlistbox", "Central Logo Shown"),
},
{
'label': i18ndc("plasma_wallpaper_org.kde.plasma.random", "@item:inlistbox", "Central Logo Focused"),
},
{
'label': i18ndc("plasma_wallpaper_org.kde.plasma.random", "@item:inlistbox", "Central Logo Colored"),
},
{
'label': i18ndc("plasma_wallpaper_org.kde.plasma.random", "@item:inlistbox", "Left to deside"),
},
{
'label': i18ndc("plasma_wallpaper_org.kde.plasma.random", "@item:inlistbox", "Left to decide"),
}
]
}
Item { // tighten layout
Layout.fillHeight: true
}
}
}