KQuickAddons::ManagedConfigModule
#include <KQuickAddons/ManagedConfigModule>

Public Slots | |
void | defaults () override |
void | load () override |
void | save () override |
![]() | |
virtual void | defaults () |
virtual void | load () |
void | pop () |
void | push (const QString &fileName, const QVariantMap &propertyMap=QVariantMap()) |
void | push (QQuickItem *item) |
virtual void | save () |
void | setDefaultsIndicatorsVisible (bool visible) |
void | showPassiveNotification (const QString &message, const QVariant &timeout=QVariant(), const QString &actionText=QString(), const QJSValue &callBack=QJSValue()) |
QQuickItem * | takeLast () |
Public Member Functions | |
ManagedConfigModule (const KAboutData *aboutData, QObject *parent=nullptr, const QVariantList &args=QVariantList()) | |
ManagedConfigModule (const KPluginMetaData &metaData, QObject *parent=nullptr, const QVariantList &args=QVariantList()) | |
ManagedConfigModule (QObject *parent, const KPluginMetaData &metaData, const QVariantList &args=QVariantList()) | |
ManagedConfigModule (QObject *parent=nullptr, const QVariantList &args=QVariantList()) | |
~ManagedConfigModule () override | |
![]() | |
ConfigModule (const KAboutData *aboutData, QObject *parent=nullptr, const QVariantList &args=QVariantList()) | |
ConfigModule (const KPluginMetaData &metaData, QObject *parent=nullptr, const QVariantList &args=QVariantList()) | |
ConfigModule (QObject *parent, const KPluginMetaData &metaData, const QVariantList &args=QVariantList()) | |
ConfigModule (QObject *parent=nullptr, const QVariantList &args=QVariantList()) | |
~ConfigModule () override | |
const KAboutData * | aboutData () const |
QString | authActionName () const |
Buttons | buttons () const |
int | columnWidth () const |
int | currentIndex () const |
bool | defaultsIndicatorsVisible () const |
int | depth () const |
QString | description () const |
QQmlEngine * | engine () const |
QString | errorString () const |
QQuickItem * | mainUi () |
QString | name () const |
bool | needsAuthorization () const |
bool | needsSave () |
QString | quickHelp () const |
bool | representsDefaults () |
QString | rootOnlyMessage () const |
void | setAboutData (const KAboutData *about) |
void | setAuthActionName (const QString &action) |
void | setButtons (const Buttons btn) |
void | setColumnWidth (int width) |
void | setCurrentIndex (int index) |
void | setNeedsAuthorization (bool needsAuth) |
void | setNeedsSave (bool needs) |
void | setQuickHelp (const QString &help) |
void | setRepresentsDefaults (bool defaults) |
void | setRootOnlyMessage (const QString &message) |
void | setUseRootOnlyMessage (bool on) |
QQmlComponent::Status | status () const |
QQuickItem * | subPage (int index) const |
bool | useRootOnlyMessage () const |
![]() | |
QObject (QObject *parent) | |
bool | blockSignals (bool block) |
const QObjectList & | children () const const |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectInfo () |
void | dumpObjectInfo () const const |
void | dumpObjectTree () |
void | dumpObjectTree () const const |
QList< QByteArray > | dynamicPropertyNames () const const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegExp ®Exp, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
bool | inherits (const char *className) const const |
void | installEventFilter (QObject *filterObj) |
bool | isWidgetType () const const |
bool | isWindowType () const const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const const |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
QVariant | property (const char *name) const const |
Q_CLASSINFO (Name, Value) | |
Q_DISABLE_COPY (Class) | |
Q_DISABLE_COPY_MOVE (Class) | |
Q_DISABLE_MOVE (Class) | |
Q_EMIT Q_EMIT | |
Q_ENUM (...) | |
Q_ENUM_NS (...) | |
Q_ENUMS (...) | |
Q_FLAG (...) | |
Q_FLAG_NS (...) | |
Q_FLAGS (...) | |
Q_GADGET Q_GADGET | |
Q_INTERFACES (...) | |
Q_INVOKABLE Q_INVOKABLE | |
Q_NAMESPACE Q_NAMESPACE | |
Q_NAMESPACE_EXPORT (EXPORT_MACRO) | |
Q_OBJECT Q_OBJECT | |
Q_PROPERTY (...) | |
Q_REVISION Q_REVISION | |
Q_SET_OBJECT_NAME (Object) | |
Q_SIGNAL Q_SIGNAL | |
Q_SIGNALS Q_SIGNALS | |
Q_SLOT Q_SLOT | |
Q_SLOTS Q_SLOTS | |
T | qFindChild (const QObject *obj, const QString &name) |
QList< T > | qFindChildren (const QObject *obj, const QRegExp ®Exp) |
QList< T > | qFindChildren (const QObject *obj, const QString &name) |
T | qobject_cast (const QObject *object) |
T | qobject_cast (QObject *object) |
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
void | removeEventFilter (QObject *obj) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const const |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType) |
QThread * | thread () const const |
Protected Slots | |
void | registerSettings (KCoreConfigSkeleton *skeleton) |
void | settingsChanged () |
Additional Inherited Members | |
![]() | |
enum | Button { NoAdditionalButton = 0, Help = 1, Default = 2, Apply = 4 } |
typedef QFlags< Button > | Buttons |
![]() | |
KQuickAddons::ConfigModule::Buttons | buttons |
int | columnWidth |
int | currentIndex |
int | defaultsIndicatorsVisible |
int | depth |
QString | description |
QQuickItem | mainUi |
QString | name |
bool | needsAuthorization |
bool | needsSave |
QString | quickHelp |
bool | representsDefaults |
QString | rootOnlyMessage |
bool | useRootOnlyMessage |
![]() | |
objectName | |
![]() | |
void | authActionNameChanged () |
void | buttonsChanged () |
void | columnWidthChanged (int width) |
void | currentIndexChanged (int index) |
void | defaultsIndicatorsVisibleChanged () |
void | depthChanged (int index) |
void | needsAuthorizationChanged () |
void | needsSaveChanged () |
void | pagePushed (QQuickItem *page) |
void | pageRemoved () |
void | passiveNotificationRequested (const QString &message, const QVariant &timeout, const QString &actionText, const QJSValue &callBack) |
void | quickHelpChanged () |
void | representsDefaultsChanged () |
void | rootOnlyMessageChanged () |
void | useRootOnlyMessageChanged () |
![]() | |
static ConfigModule * | qmlAttachedProperties (QObject *object) |
![]() | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
![]() | |
typedef | QObjectList |
![]() | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
bool | isSignalConnected (const QMetaMethod &signal) const const |
int | receivers (const char *signal) const const |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
Detailed Description
The base class for configuration modules using KConfigXT settings.
Configuration modules are realized as plugins that are loaded only when needed.
The module in principle is a simple widget displaying the item to be changed. The module has a very small interface.
All the necessary glue logic and the GUI bells and whistles are provided by the control center and must not concern the module author.
To write a config module, you have to create a C++ library and an accompaning QML user interface. The library must contain a factory function like the following:
The constructor of the ManagedConfigModule then looks like this:
The QML part must be in the KPackage format, installed under share/kpackage/kcms.
- See also
- KPackage::Package
The package must have the same name as the C++ plugin, to be installed by CMake with the command:
The "packagedir" is the subdirectory in the source tree where the package sources are located, and "kcm_componentName" is the name of the C++ plugin. Finally "kcms" is the literal string "kcms", so that the package is installed as a configuration module (and not some other kind of package). The main config dialog UI will be the file ui/main.qml from the package (or what X-KPackage-MainScript value is in the package metadata desktop file).
The QML part can access all the properties of ConfigModule (together with the properties defined in its subclass) by accessing to the global object "kcm", or with the import of "org.kde.kcm 1.0" the ConfigModule attached property.
See https://develop.kde.org/docs/extend/kcm/ for more detailed documentation.
- Since
- 5.65
Definition at line 99 of file managedconfigmodule.h.
Constructor & Destructor Documentation
◆ ManagedConfigModule() [1/4]
|
explicit |
Base class for all modules which manage automatically some of their state.
- Parameters
-
aboutData becomes owned by the ManagedConfigModule
- Deprecated:
- since 5.88, use ManagedConfigModule(QObject*, KPluginMetaData, QVariantList)
Definition at line 32 of file managedconfigmodule.cpp.
◆ ManagedConfigModule() [2/4]
|
explicit |
- Parameters
-
metaData description for the plugin: it will generate a KAboutData from that
- Deprecated:
- since 5.88, use ManagedConfigModule(QObject*, KPluginMetaData, QVariantList)
Definition at line 40 of file managedconfigmodule.cpp.
◆ ManagedConfigModule() [3/4]
|
explicit |
Base class for all KControlModules.
- Note
- do not emit changed signals here, since they are not yet connected to any slot.
- Since
- 5.88
Definition at line 55 of file managedconfigmodule.cpp.
◆ ManagedConfigModule() [4/4]
|
explicit |
Base class for all KControlModules.
- Note
- do not emit changed signals here, since they are not yet connected to any slot.
- Deprecated:
- since 5.104, use ManagedConfigModule(QObject*, KPluginMetaData, QVariantList)
Definition at line 48 of file managedconfigmodule.cpp.
◆ ~ManagedConfigModule()
|
override |
Destroys the module.
Definition at line 61 of file managedconfigmodule.cpp.
Member Function Documentation
◆ defaults
|
overrideslot |
Sets the configuration to sensible default values.
This method is called when the user clicks the "Default" button. It should set the display to useful values.
By default this will reset to defaults the child setting objects of this module.
Definition at line 84 of file managedconfigmodule.cpp.
◆ load
|
overrideslot |
Load the configuration data into the module.
This method is invoked whenever the module should read its configuration (most of the times from a config file) and update the user interface. This happens when the user clicks the "Reset" button in the control center, to undo all of his changes and restore the currently valid settings. It is also called right after construction.
By default this will load the settings from the child setting objects of this module.
Definition at line 66 of file managedconfigmodule.cpp.
◆ registerSettings
|
protectedslot |
Allow to register manually settings class generated from a kcfg file.
Used by derived class when automatic discovery is not possible. After skeleton is registered it will automatically call settingsChanged().
- Since
- 5.67
Definition at line 134 of file managedconfigmodule.cpp.
◆ save
|
overrideslot |
Save the configuration data.
The save method stores the config information as shown in the user interface in the config files. It is called when the user clicks "Apply" or "Ok".
By default this will save the child setting objects of this module.
Definition at line 75 of file managedconfigmodule.cpp.
◆ settingsChanged
|
protectedslot |
Forces the module to reevaluate the saveNeeded and representsDefault state.
This is required for some modules which might have some settings managed outside of KConfigXT objects.
Definition at line 111 of file managedconfigmodule.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Nov 30 2023 04:03:15 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.