KDeclarative
configmodule.cpp
72 QHash<QObject *, ConfigModule *> ConfigModulePrivate::s_rootObjects = QHash<QObject *, ConfigModule *>();
81 ConfigModule::ConfigModule(const KPluginMetaData &metaData, QObject *parent, const QVariantList &)
84 KAboutData *aboutData = new KAboutData(metaData.pluginId(), metaData.name(), metaData.version(), metaData.description(), KAboutLicense::byKeyword(metaData.license()).key());
88 aboutData->addAuthor(author.name(), author.task(), author.emailAddress(), author.webAddress(), author.ocsUsername());
114 //at the moment of the attached object creation, the root item is the only one that hasn't a parent
159 KPackage::Package package = KPackage::PackageLoader::self()->loadPackage(QStringLiteral("KPackage/GenericQML"));
165 qWarning() << "Error loading the module" << aboutData()->componentName() << ": invalid KPackage";
171 qWarning() << "Error loading the module" << aboutData()->componentName() << ": no QML file provided";
196 KPackage::Package package = KPackage::PackageLoader::self()->loadPackage(QStringLiteral("KPackage/GenericQML"));
205 QObject *object = d->_qmlObject->createObjectFromSource(QUrl::fromLocalFile(package.filePath("ui", fileName)),
247 void ConfigModule::showPassiveNotification(const QString &message, const QVariant &timeout, const QString &actionText, const QJSValue &callBack)
275 d->_authActionName = QLatin1String("org.kde.kcontrol.") + d->_about->componentName() + QLatin1String(".save");
void defaultsIndicatorsVisibleChanged()
Emitted when kcm need to display indicators for field with non default value.
const KAboutData * aboutData() const
This is generally only called for the KBugReport.
Definition: configmodule.cpp:388
QString description() const
void setNeedsSave(bool needs)
Set this property to true when the user changes something in the module, signaling that a save (such ...
Definition: configmodule.cpp:453
QList< KAboutPerson > authors() const
virtual void defaults()
Sets the configuration to sensible default values.
Definition: configmodule.cpp:384
QString name() const
QString componentName() const
void representsDefaultsChanged()
Indicate that the state of the modules contents has changed in a way that it might represents the def...
void setCurrentIndex(int index)
Sets the current page index this kcm should display.
Definition: configmodule.cpp:321
void authActionNameChanged()
The auth action name has changed: this signal will relay it to the actual KCM.
int columnWidth() const
returns the width the kcm wants in column mode.
QQmlContext * parentContext() const const
void setUseRootOnlyMessage(bool on)
Change whether or not the RootOnly message should be shown.
Definition: configmodule.cpp:416
void needsAuthorizationChanged()
Emits this signal whenever the need for root authorization to save changes.
Definition: configmodule.cpp:31
An object that instantiates an entire QML context, with its own declarative engine.
Definition: qmlobject.h:38
bool useRootOnlyMessage() const
Tell if KControl should show a RootOnly message when run as a normal user.
void setRepresentsDefaults(bool defaults)
Set this property to true when the user sets the state of the module to the default settings (e...
Definition: configmodule.cpp:468
void showPassiveNotification(const QString &message, const QVariant &timeout=QVariant(), const QString &actionText=QString(), const QJSValue &callBack=QJSValue())
Ask the shell to show a passive notification.
Definition: configmodule.cpp:247
QString rootOnlyMessage() const
Get the RootOnly message for this module.
void setDefaultPackageRoot(const QString &packageRoot)
KAboutData & addAuthor(const QString &name, const QString &task=QString(), const QString &emailAddress=QString(), const QString &webAddress=QString(), const QString &ocsUsername=QString())
void setAboutData(const KAboutData *about)
This sets the KAboutData returned by aboutData() The about data is now owned by ConfigModule.
Definition: configmodule.cpp:393
int depth() const
void useRootOnlyMessageChanged()
Emits this signal whenever the root only message gets used or discarded.
void currentIndexChanged(int index)
Emitted when the current page changed.
void pagePushed(QQuickItem *page)
Emitted when a new sub page is pushed.
Ready
void columnWidthChanged(int width)
Emitted when the wanted column width of the kcm changes.
void quickHelpChanged()
Indicate that the module's quickhelp has changed.
QQuickItem * mainUi()
void deleteLater()
QQmlContext * rootContext() const const
int remove(const Key &key)
bool needsSave()
True when the module has something changed and needs save.
QQmlEngine * engine() const const
const T value(const Key &key) const const
int currentIndex() const
void setAuthActionName(const QString &action)
Set if the module's save() method requires authorization to be executed.
Definition: configmodule.cpp:337
QString license() const
QString i18n(const char *text, const TYPE &arg...)
QString name() const
QString authActionName() const
Returns the action previously set with setAuthActionName().
Definition: configmodule.cpp:350
void setDefaultsIndicatorsVisible(bool visible)
Change defaultness indicator visibility.
Definition: configmodule.cpp:488
ConfigModule(const KAboutData *aboutData, QObject *parent=nullptr, const QVariantList &args=QVariantList())
Base class for all KControlModules.
Definition: configmodule.cpp:75
static KAboutLicense byKeyword(const QString &keyword)
void passiveNotificationRequested(const QString &message, const QVariant &timeout, const QString &actionText, const QJSValue &callBack)
Emitted when the kcm wants the shell to display a passive notification.
void setRootOnlyMessage(const QString &message)
Sets the RootOnly message.
Definition: configmodule.cpp:401
QQmlContext * contextForObject(const QObject *object)
bool representsDefaults()
True when the module state represents the default settings.
bool needsAuthorization() const
Returns the value previously set with setNeedsAuthorization() or setAuthActionName().
bool contains(const Key &key) const const
void depthChanged(int index)
Emitted when the number of pages changed.
QString description() const
QString errorString() const
The error string in case the mainUi failed to load.
Definition: configmodule.cpp:369
T qobject_cast(QObject *object)
QObject * parent() const const
void rootOnlyMessageChanged()
Indicate that the module's root message has changed.
bool defaultsIndicatorsVisible() const
void push(const QString &fileName, const QVariantMap &propertyMap=QVariantMap())
Push a new sub page in the KCM hierarchy: pages will be seen as a Kirigami PageRow.
Definition: configmodule.cpp:188
Q_EMITQ_EMIT
QString pluginId() const
QUrl fromLocalFile(const QString &localFile)
QString version() const
QQmlComponent::Status status() const
The status of the mainUi component.
Definition: configmodule.cpp:360
void setNeedsAuthorization(bool needsAuth)
Set if the module's save() method requires authorization to be executed.
Definition: configmodule.cpp:267
void needsSaveChanged()
Indicate that the state of the modules contents has changed.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jan 25 2021 22:44:28 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jan 25 2021 22:44:28 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.