KDECore
kpluginfactory.h
Go to the documentation of this file.
127 #define K_PLUGIN_FACTORY(name, pluginRegistrations) K_PLUGIN_FACTORY_WITH_BASEFACTORY(name, KPluginFactory, pluginRegistrations)
140 #define K_PLUGIN_FACTORY_DECLARATION(name) K_PLUGIN_FACTORY_DECLARATION_WITH_BASEFACTORY(name, KPluginFactory)
156 #define K_PLUGIN_FACTORY_DEFINITION(name, pluginRegistrations) K_PLUGIN_FACTORY_DEFINITION_WITH_BASEFACTORY(name, KPluginFactory, pluginRegistrations)
247 explicit KPluginFactory(const char *componentName = 0, const char *catalogName = 0, QObject *parent = 0);
263 KDE_CONSTRUCTOR_DEPRECATED explicit KPluginFactory(const KAboutData *aboutData, QObject *parent = 0);
319 T *create(const QString &keyword, QObject *parent = 0, const QVariantList &args = QVariantList());
335 T *create(QWidget *parentWidget, QObject *parent, const QString &keyword = QString(), const QVariantList &args = QVariantList());
353 KDE_DEPRECATED QObject *create(QObject *parent = 0, const char *classname = "QObject", const QStringList &args = QStringList())
428 virtual KDE_DEPRECATED QObject *createObject(QObject *parent, const char *className, const QStringList &args);
435 virtual KDE_DEPRECATED KParts::Part *createPartObject(QWidget *parentWidget, QObject *parent, const char *classname, const QStringList &args);
466 virtual QObject *create(const char *iface, QWidget *parentWidget, QObject *parent, const QVariantList &args, const QString &keyword);
469 static QObject *createInstance(QWidget *parentWidget, QObject *parent, const QVariantList &args)
481 static QObject *createPartInstance(QWidget *parentWidget, QObject *parent, const QVariantList &args)
493 CreateInstanceFunction createInstanceFunction(KParts::Part *) { return &createPartInstance<impl>; }
494 CreateInstanceFunction createInstanceFunction(QWidget *) { return &createInstance<impl, QWidget>; }
499 void registerPlugin(const QString &keyword, const QMetaObject *metaObject, CreateInstanceFunction instanceFunction);
507 QObject *o = create(T::staticMetaObject.className(), parent && parent->isWidgetType() ? reinterpret_cast<QWidget *>(parent): 0, parent, args, QString());
517 inline T *KPluginFactory::create(const QString &keyword, QObject *parent, const QVariantList &args)
519 QObject *o = create(T::staticMetaObject.className(), parent && parent->isWidgetType() ? reinterpret_cast<QWidget *>(parent): 0, parent, args, keyword);
529 inline T *KPluginFactory::create(QWidget *parentWidget, QObject *parent, const QString &keyword, const QVariantList &args)
const char * className() const
static QObject * createInstance(QWidget *parentWidget, QObject *parent, const QVariantList &args)
Definition: kpluginfactory.h:469
CreateInstanceFunction createInstanceFunction(...)
Definition: kpluginfactory.h:495
T * create(QObject *parent=0, const QVariantList &args=QVariantList())
Use this method to create an object.
Definition: kpluginfactory.h:505
#define T
T * create(QObject *parent, const QStringList &args)
Definition: kpluginfactory.h:343
#define KDE_CONSTRUCTOR_DEPRECATED
The KDE_CONSTRUCTOR_DEPRECATED macro can be used to trigger compile-time warnings with newer compiler...
Definition: kdemacros.h.cmake:207
This is used to detect the arguments need for the constructor of plugin classes.
Definition: kpluginfactory.h:491
CreateInstanceFunction createInstanceFunction(QWidget *)
Definition: kpluginfactory.h:494
void registerPlugin(const QString &keyword=QString(), CreateInstanceFunction instanceFunction=InheritanceChecker< T >().createInstanceFunction(reinterpret_cast< T * >(0)))
Registers a plugin with the factory.
Definition: kpluginfactory.h:402
Definition: kpluginfactory_p.h:33
CreateInstanceFunction createInstanceFunction(KParts::Part *)
Definition: kpluginfactory.h:493
QObject * create(QObject *parent=0, const char *classname="QObject", const QStringList &args=QStringList())
Definition: kpluginfactory.h:353
static QObject * createPartInstance(QWidget *parentWidget, QObject *parent, const QVariantList &args)
Definition: kpluginfactory.h:481
bool isWidgetType() const
QObject * parent() const
If you develop a library that is to be loaded dynamically at runtime, then you should return a pointe...
Definition: kpluginfactory.h:232
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.