KCModule
#include <KCModule>
Public Member Functions | |
KCModule (QWidget *parent, const KPluginMetaData &data) | |
~KCModule () override | |
QList< KConfigDialogManager * > | configs () const |
void | defaults () override |
void | load () override |
void | markAsChanged () |
void | save () override |
virtual QWidget * | widget () |
Public Member Functions inherited from KAbstractConfigModule | |
KAbstractConfigModule (QObject *parent, const KPluginMetaData &metaData) | |
Q_SIGNAL void | activationRequested (const QVariantList &args) |
QString | authActionName () const |
Q_SIGNAL void | authActionNameChanged () |
Buttons | buttons () const |
Q_SIGNAL void | buttonsChanged () |
bool | defaultsIndicatorsVisible () const |
Q_SIGNAL void | defaultsIndicatorsVisibleChanged () |
QString | description () const |
KPluginMetaData | metaData () const |
QString | name () const |
bool | needsAuthorization () const |
bool | needsSave () const |
Q_SIGNAL void | needsSaveChanged () |
bool | representsDefaults () const |
Q_SIGNAL void | representsDefaultsChanged () |
void | setAuthActionName (const QString &action) |
void | setButtons (const Buttons btn) |
void | setDefaultsIndicatorsVisible (bool visible) |
void | setNeedsSave (bool needs) |
void | setRepresentsDefaults (bool defaults) |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QBindable< QString > | bindableObjectName () |
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 () const const |
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 QRegularExpression &re, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (Qt::FindChildOptions options) const const |
bool | inherits (const char *className) const const |
void | installEventFilter (QObject *filterObj) |
bool | isQuickItemType () const const |
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_EMIT Q_EMIT | |
Q_ENUM (...) | |
Q_ENUM_NS (...) | |
Q_ENUMS (...) | |
Q_FLAG (...) | |
Q_FLAG_NS (...) | |
Q_FLAGS (...) | |
Q_GADGET Q_GADGET | |
Q_GADGET_EXPORT (EXPORT_MACRO) | |
Q_INTERFACES (...) | |
Q_INVOKABLE Q_INVOKABLE | |
Q_MOC_INCLUDE Q_MOC_INCLUDE | |
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 | 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 | setObjectName (QAnyStringView name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | setProperty (const char *name, QVariant &&value) |
bool | signalsBlocked () const const |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType) |
QThread * | thread () const const |
Protected Slots | |
void | widgetChanged () |
Protected Member Functions | |
KCModule (QObject *parent) | |
KCModule (QObject *parent, const KPluginMetaData &data) | |
KConfigDialogManager * | addConfig (KCoreConfigSkeleton *config, QWidget *widget) |
bool | managedWidgetChangeState () const |
bool | managedWidgetDefaultState () const |
void | unmanagedWidgetChangeState (bool) |
void | unmanagedWidgetDefaultState (bool) |
Protected Member Functions inherited from QObject | |
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) |
Additional Inherited Members | |
Public Types inherited from KAbstractConfigModule | |
enum | Button { NoAdditionalButton = 0 , Help = 1 , Default = 2 , Apply = 4 , Export = 8 } |
typedef QFlags< Button > | Buttons |
Public Types inherited from QObject | |
typedef | QObjectList |
Properties inherited from KAbstractConfigModule | |
KAbstractConfigModule::Buttons | buttons |
bool | defaultsIndicatorsVisible |
QString | description |
QString | name |
bool | needsAuthorization |
bool | needsSave |
bool | representsDefaults |
Properties inherited from QObject | |
objectName | |
Static Public Member Functions inherited from QObject | |
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) |
Detailed Description
The base class for QWidgets configuration modules.
Configuration modules are loaded as plugins.
The module in principle is a simple widget displaying the item to be changed. The module has a very small interface.
To write a config module, you have to create a library that contains a factory class like the following:
The constructor of the KCModule then looks like this:
This KCM can be loaded in a KCMultiDialog of kcmshell6
- Since
- 6.0
Definition at line 58 of file kcmodule.h.
Constructor & Destructor Documentation
◆ KCModule() [1/3]
|
explicit |
Base class for all QWidgets configuration modules.
- Note
- do not emit changed signals here, since they are not yet connected to any slot.
Definition at line 60 of file kcmodule.cpp.
◆ ~KCModule()
|
override |
Destroys the module.
Definition at line 78 of file kcmodule.cpp.
◆ KCModule() [2/3]
|
inlineexplicitprotected |
Utility overload to avoid having to take both parent and parentWidget KCModuleLoader::loadModule enforces the parent to be a QWidget anyway.
Definition at line 147 of file kcmodule.h.
◆ KCModule() [3/3]
|
inlineexplicitprotected |
Utility constructor for creating a KCModule that is embedded, for example in a KPluginWidget This constructor should not be used for KCMs that are part launched in systemsettings!
- Note
- do not emit changed signals here, since they are not yet connected to any slot.
Definition at line 159 of file kcmodule.h.
Member Function Documentation
◆ addConfig()
|
protected |
Adds a KCoreConfigskeleton config
to watch the widget widget
.
This function is useful if you need to handle multiple configuration files.
- Returns
- a pointer to the KCoreConfigDialogManager in use
- Parameters
-
config the KCoreConfigSkeleton to use widget the widget to watch
Definition at line 66 of file kcmodule.cpp.
◆ configs()
QList< KConfigDialogManager * > KCModule::configs | ( | ) | const |
- Returns
- a list of KConfigDialogManager's in use, if any.
Definition at line 164 of file kcmodule.cpp.
◆ defaults()
|
overridevirtual |
Sets the configuration to default values.
This method is called when the user clicks the "Default" button.
Reimplemented from KAbstractConfigModule.
Definition at line 101 of file kcmodule.cpp.
◆ load()
|
overridevirtual |
Load the configuration data into the module.
The load method sets the user interface elements of the module to reflect the current settings stored in the configuration files.
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.
Reimplemented from KAbstractConfigModule.
Definition at line 84 of file kcmodule.cpp.
◆ managedWidgetChangeState()
|
protected |
Returns the changed state of automatically managed widgets in this dialog.
Definition at line 129 of file kcmodule.cpp.
◆ managedWidgetDefaultState()
|
protected |
Returns the defaulted state of automatically managed widgets in this dialog.
Definition at line 140 of file kcmodule.cpp.
◆ markAsChanged()
|
inline |
Utility function that marks the KCM as changed.
Definition at line 88 of file kcmodule.h.
◆ save()
|
overridevirtual |
The save method stores the config information as shown in the user interface in the config files.
This method is called when the user clicks "Apply" or "Ok".
Reimplemented from KAbstractConfigModule.
Definition at line 93 of file kcmodule.cpp.
◆ unmanagedWidgetChangeState()
|
protected |
Call this method when your manually managed widgets change state between changed and not changed.
Definition at line 151 of file kcmodule.cpp.
◆ unmanagedWidgetDefaultState()
|
protected |
Call this method when your manually managed widgets change state between defaulted and not defaulted.
Definition at line 157 of file kcmodule.cpp.
◆ widget()
|
virtual |
Get the associated widget that can be embedded The returned widget should be used as a parent for widgets you create.
- Note
- Overwriting this function should not be necessary for consumers!
Definition at line 109 of file kcmodule.cpp.
◆ widgetChanged
|
protectedslot |
A managed widget was changed, the widget settings and the current settings are compared and a corresponding needsSaveChanged() signal is emitted.
Definition at line 119 of file kcmodule.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:08:27 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.