KDECore
kpluginfactory.cpp
Go to the documentation of this file.
33 KPluginFactory::KPluginFactory(const char *componentName, const char *catalogName, QObject *parent)
100 void KPluginFactory::registerPlugin(const QString &keyword, const QMetaObject *metaObject, CreateInstanceFunction instanceFunction)
109 kFatal(kLibraryDebugArea()) << "A plugin with the keyword" << keyword << "was already registered. A keyword must be unique!";
111 d->createInstanceHash.insert(keyword, KPluginFactoryPrivate::Plugin(metaObject, instanceFunction));
120 kFatal(kLibraryDebugArea()) << "Two plugins with the same interface(" << superClass->className() << ") were registered. Use keywords to identify the plugins.";
131 kFatal(kLibraryDebugArea()) << "Two plugins with the same interface(" << superClass->className() << ") were registered. Use keywords to identify the plugins.";
136 d->createInstanceHash.insertMulti(keyword, KPluginFactoryPrivate::Plugin(metaObject, instanceFunction));
141 QObject *KPluginFactory::createObject(QObject *parent, const char *className, const QStringList &args)
151 KParts::Part *KPluginFactory::createPartObject(QWidget *parentWidget, QObject *parent, const char *classname, const QStringList &args)
161 QObject *KPluginFactory::create(const char *iface, QWidget *parentWidget, QObject *parent, const QVariantList &args, const QString &keyword)
182 if ((obj = reinterpret_cast<QObject *>(createPartObject(parentWidget, parent, kpartsIface, argsStringList)))) {
201 kFatal(kLibraryDebugArea()) << "ambiguous interface requested from a DSO containing more than one plugin";
QVariantList stringListToVariantList(const QStringList &list)
Definition: kpluginfactory.cpp:241
T * create(QObject *parent=0, const QVariantList &args=QVariantList())
Use this method to create an object.
Definition: kpluginfactory.h:505
#define K_GLOBAL_STATIC(TYPE, NAME)
This macro makes it easy to use non-POD types as global statics.
Definition: kglobal.h:221
void removeCatalog(const QString &catalog)
Removes a catalog for translation lookup.
Definition: klocale.cpp:141
KComponentData componentData() const
You can use this method to get the component data of the plugin.
Definition: kpluginfactory.cpp:94
void objectCreated(QObject *object)
QStringList variantListToStringList(const QVariantList &list)
Definition: kpluginfactory.cpp:232
void setComponentData(const KComponentData &componentData)
This method sets the component data of the plugin.
Definition: kpluginfactory.cpp:225
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
void insertCatalog(const QString &catalog)
Adds another catalog to search for translation lookup.
Definition: klocale.cpp:136
KPluginFactory(const char *componentName=0, const char *catalogName=0, QObject *parent=0)
This constructor creates a factory for a plugin with the given componentName and catalogName.
Definition: kpluginfactory.cpp:33
Definition: kpluginfactory_p.h:33
virtual KParts::Part * createPartObject(QWidget *parentWidget, QObject *parent, const char *classname, const QStringList &args)
Definition: kpluginfactory.cpp:151
virtual QObject * createObject(QObject *parent, const char *className, const QStringList &args)
Definition: kpluginfactory.cpp:141
If you develop a library that is to be loaded dynamically at runtime, then you should return a pointe...
Definition: kpluginfactory.h:232
Definition: kaboutdata.h:33
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:47:09 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:47:09 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.