KCMUtils
kpluginmodel.h
26 * Plugins need to define the @c X-KDE-ConfigModule property for their config modules to be found.
28 * An example value is "kf6/krunner/kcms/kcm_krunner_charrunner", "kf6/krunner/kcms" is the namespace
29 * and "kcm_krunner_charrunner" the file name. The loaded KCMs don't need any embedded JSON metadata.
61 bool moveRows(const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild) override;
74 * This is useful in case your app has a custom sorting mechanism or implements reordering of plugins
KPluginMetaData findConfigForPluginId(const QString &pluginId) const
Returns the KPluginMetaData object of the plugin's config module.
Definition kpluginmodel.cpp:250
void addUnsortablePlugins(const QList< KPluginMetaData > &plugins, const QString &categoryLabel)
Add plugins that should not be sorted automatically based on their name This is useful in case your a...
Definition kpluginmodel.cpp:163
void load()
Load the enabled state of the plugins from the config group set by setConfig.
Definition kpluginmodel.cpp:260
Q_SIGNAL void isSaveNeededChanged()
Emitted when isSaveNeeded is changed.
void addPlugins(const QList< KPluginMetaData > &plugins, const QString &categoryLabel)
Append plugins to the model.
Definition kpluginmodel.cpp:189
void defaults()
Reset the enabled state of the plugins to its defaults.
Definition kpluginmodel.cpp:270
Q_SIGNAL void defaulted(bool isDefaulted)
Emitted when the enabled state matches the default changes.
void removePlugin(const KPluginMetaData &data)
Definition kpluginmodel.cpp:205
void setConfig(const KConfigGroup &config)
Set the KConfigGroup that is used to load/save the enabled state.
Definition kpluginmodel.cpp:215
bool isSaveNeeded()
Whether or not there are unsaved changes to the enabled state of the plugins.
Definition kpluginmodel.cpp:289
void save()
Save the enabled state of the plugins to the config group set by setConfig.
Definition kpluginmodel.cpp:238
virtual QVariant data(const QModelIndex &index, int role) const const=0
virtual bool moveRows(const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild)
virtual QModelIndex parent(const QModelIndex &index) const const=0
virtual QHash< int, QByteArray > roleNames() const const
virtual int rowCount(const QModelIndex &parent) const const=0
virtual bool setData(const QModelIndex &index, const QVariant &value, int role)
QAbstractListModel(QObject *parent)
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const override
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
Q_SIGNALQ_SIGNAL
DisplayRole
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:51:31 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:51:31 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.