KCoreAddons
kpluginfactory.cpp
42 result.errorString = tr("Could not load plugin from %1: %2").arg(data.fileName(), loader.errorString());
43 result.errorText = QStringLiteral("Could not load plugin from %1: %2").arg(data.fileName(), loader.errorString());
55 qCWarning(KCOREADDONS_DEBUG) << "Expected a KPluginFactory, got a" << obj->metaObject()->className();
75void KPluginFactory::registerPlugin(const QMetaObject *metaObject, CreateInstanceWithMetaDataFunction instanceFunction)
81 for (const KPluginFactoryPrivate::PluginWithMetadata &plugin : d->createInstanceWithMetaDataHash) {
82 for (const QMetaObject *otherSuper = plugin.first->superClass(); otherSuper; otherSuper = otherSuper->superClass()) {
84 qCWarning(KCOREADDONS_DEBUG).nospace() << "Two plugins with the same interface (" << superClass->className()
91 for (const KPluginFactoryPrivate::PluginWithMetadata &plugin : d->createInstanceWithMetaDataHash) {
93 for (const QMetaObject *otherSuper = metaObject->superClass(); otherSuper; otherSuper = otherSuper->superClass()) {
95 qCWarning(KCOREADDONS_DEBUG).nospace() << "Two plugins with the same interface (" << superClass->className()
110 qCWarning(KCOREADDONS_DEBUG) << "KPluginFactory could not create a" << className << "instance from" << data.fileName();
113QObject *KPluginFactory::create(const char *iface, QWidget *parentWidget, QObject *parent, const QVariantList &args)
Holds the result of a plugin load operation, i.e.
Definition kpluginfactory.h:327
KPluginFactory provides a convenient way to provide factory-style plugins.
Definition kpluginfactory.h:300
static Result< KPluginFactory > loadFactory(const KPluginMetaData &data)
Attempts to load the KPluginFactory from the given metadata.
Definition kpluginfactory.cpp:25
T * create(QObject *parent=nullptr, const QVariantList &args={})
Use this method to create an object.
Definition kpluginfactory.h:632
void registerPlugin()
Uses a default instance creation function depending on the type of interface.
Definition kpluginfactory.h:522
void setMetaData(const KPluginMetaData &metaData)
Set the metadata about the plugin this factory generates.
Definition kpluginfactory.cpp:70
This class allows easily accessing some standardized values from the JSON metadata that can be embedd...
Definition kpluginmetadata.h:82
const char * className() const const
const QMetaObject * superClass() const const
virtual const QMetaObject * metaObject() const const
QObject * parent() const const
T qobject_cast(QObject *object)
QString tr(const char *sourceText, const char *disambiguation, int n)
QString errorString() const const
QObject * instance()
QString arg(Args &&... args) const const
bool isEmpty() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 27 2024 11:54:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 27 2024 11:54:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.