KParts
Functions | |
template<class T > | |
T * | createPartInstanceFromFactory (KParts::Factory *factory, QWidget *parentWidget=0, QObject *parent=0, const QStringList &args=QStringList()) |
template<class T > | |
T * | createPartInstanceFromLibrary (const char *libraryName, QWidget *parentWidget=0, QObject *parent=0, const QStringList &args=QStringList(), int *error=0) |
template<class T > | |
T * | createPartInstanceFromQuery (const QString &mimeType, const QString &constraint, QWidget *parentWidget=0, QObject *parent=0, const QStringList &args=QStringList(), int *error=0) |
template<class T > | |
T * | createPartInstanceFromService (const KService::Ptr &service, QWidget *parentWidget=0, QObject *parent=0, const QStringList &args=QStringList(), int *error=0) |
template<class T , class ServiceIterator > | |
T * | createPartInstanceFromServices (ServiceIterator begin, ServiceIterator end, QWidget *parentWidget=0, QObject *parent=0, const QStringList &args=QStringList(), int *error=0) |
Function Documentation
T* KParts::ComponentFactory::createPartInstanceFromFactory | ( | KParts::Factory * | factory, |
QWidget * | parentWidget = 0 , |
||
QObject * | parent = 0 , |
||
const QStringList & | args = QStringList() |
||
) |
This template function allows to ask the given kparts factory to create an instance of the given template type.
Example of usage:
- Deprecated:
- use KPluginFactory::create instead
- Parameters
-
factory The factory to ask for the creation of the component parentWidget the parent widget for the part parent The parent object (see QObject constructor) args A list of string arguments, passed to the factory and possibly to the component (see KLibFactory)
- Returns
- A pointer to the newly created object or a null pointer if the factory was unable to create an object of the given type.
Definition at line 58 of file componentfactory.h.
T* KParts::ComponentFactory::createPartInstanceFromLibrary | ( | const char * | libraryName, |
QWidget * | parentWidget = 0 , |
||
QObject * | parent = 0 , |
||
const QStringList & | args = QStringList() , |
||
int * | error = 0 |
||
) |
Definition at line 80 of file componentfactory.h.
T* KParts::ComponentFactory::createPartInstanceFromQuery | ( | const QString & | mimeType, |
const QString & | constraint, | ||
QWidget * | parentWidget = 0 , |
||
QObject * | parent = 0 , |
||
const QStringList & | args = QStringList() , |
||
int * | error = 0 |
||
) |
This method creates and returns a KParts part from a serviceType (e.g.
a mimetype).
You can use this method to create a generic viewer - that can display any kind of file, provided that there is a ReadOnlyPart installed for it - in 5 lines:
- Parameters
-
mimeType the mimetype which this part is associated with constraint an optional constraint to pass to the trader (see KTrader) parentWidget the parent widget, will be set as the parent of the part's widget parent the parent object for the part itself args A list of string arguments, passed to the factory and possibly to the component (see KLibFactory) error The int passed here will receive an error code in case of errors. (See enum KLibLoader::ComponentLoadingError)
- Returns
- A pointer to the newly created object or a null pointer if the factory was unable to create an object of the given type.
Definition at line 205 of file componentfactory.h.
T* KParts::ComponentFactory::createPartInstanceFromService | ( | const KService::Ptr & | service, |
QWidget * | parentWidget = 0 , |
||
QObject * | parent = 0 , |
||
const QStringList & | args = QStringList() , |
||
int * | error = 0 |
||
) |
- Deprecated:
- use KService::createInstance instead
Definition at line 126 of file componentfactory.h.
T* KParts::ComponentFactory::createPartInstanceFromServices | ( | ServiceIterator | begin, |
ServiceIterator | end, | ||
QWidget * | parentWidget = 0 , |
||
QObject * | parent = 0 , |
||
const QStringList & | args = QStringList() , |
||
int * | error = 0 |
||
) |
Definition at line 147 of file componentfactory.h.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:50:42 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.