Plasma/PortingQMLPlasmoids

From KDE Community Wiki
Revision as of 20:18, 27 February 2013 by Notmart (talk | contribs) (Created page with "Most API the QML plasmoids will use hasn't been changed between Plasma1 and Plasma2, however there are some significant differences in some areas that will need to be consider...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Most API the QML plasmoids will use hasn't been changed between Plasma1 and Plasma2, however there are some significant differences in some areas that will need to be considered when porting a plasmoid.

Configuration

Plasma2 doesn't use .ui files anymore. Instead, config pages has to be written in QML. In order to populate the configuration dialog, put a config.qml file in the config/ directory of the plasmoid.

config.qml

The config.qml file must be an instance of the ConfigModel {} component, which can only contains ConfigCategory {} items.

 import org.kde.plasma.configuration 0.1
 ConfigModel {
     ConfigCategory {
          name: "General"
          icon: "plasma"
          source: "configGeneral.qml"
     }
     ConfigCategory {
          name: "Page2"
          icon: "config"
          source: "whatever.qml"
     }
     ...
}