KParts::PartLoader
Functions | |
template<typename T > | |
static KPluginFactory::Result< T > | instantiatePart (const KPluginMetaData &data, QWidget *parentWidget=nullptr, QObject *parent=nullptr, const QVariantList &args={}) |
template<class T > | |
static KPluginFactory::Result< T > | instantiatePartForMimeType (const QString &mimeType, QWidget *parentWidget=nullptr, QObject *parent=nullptr, const QVariantList &args={}) |
KPARTS_EXPORT PartCapabilities | partCapabilities (const KPluginMetaData &data) |
KPARTS_EXPORT QList< KPluginMetaData > | partsForMimeType (const QString &mimeType) |
Detailed Description
Helper methods for locating and loading parts.
This is based upon KPluginFactory, but it takes care of querying by mimetype, sorting the available parts by builtin preference and by user preference.
- Since
- 5.69
Function Documentation
◆ instantiatePart()
|
static |
Attempts to create a KPart from the given metadata.
- Parameters
-
data KPluginMetaData from which the plugin should be loaded parentWidget The parent widget parent The parent object args A list of arguments to be passed to the part
- Returns
- Result object which contains the plugin instance and potentially error information
- Since
- 5.100
Definition at line 115 of file partloader.h.
◆ instantiatePartForMimeType()
|
static |
Use this method to create a KParts part.
It will try to create an object which inherits T
.
- Template Parameters
-
T The interface for which an object should be created. The object will inherit T
.
- Parameters
-
mimeType The mimetype for which we need a KParts. parentWidget The parent widget for the part's widget. parent The parent of the part.
- Returns
- Result object which contains the plugin instance and potentially error information
- Since
- 5.100
Definition at line 156 of file partloader.h.
◆ partCapabilities()
KParts::PartCapabilities KParts::PartLoader::partCapabilities | ( | const KPluginMetaData & | data | ) |
Parses the associated capabilities from the KPart.
This parses the deprecated "ServiceTypes" array of the "KPlugin" object
- Since
- 6.4
Definition at line 57 of file partloader.cpp.
◆ partsForMimeType()
QList< KPluginMetaData > KParts::PartLoader::partsForMimeType | ( | const QString & | mimeType | ) |
Locate all available KParts using KPluginMetaData::findPlugins for a mimetype.
- Returns
- a list of plugin metadata, sorted by preference. This takes care both of the builtin preference (set by developers) and of user preference (stored in mimeapps.list).
To load a part from one of the KPluginMetaData instances returned here, use instantiatePart()
- Since
- 5.69
Definition at line 101 of file partloader.cpp.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:58:58 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.