KParts::PartBase
#include <KParts/PartBase>

Protected Types | |
enum | PluginLoadingMode { DoNotLoadPlugins = 0, LoadPlugins = 1, LoadPluginsIfEnabled = 2 } |
Protected Member Functions | |
KPARTS_NO_EXPORT | PartBase (PartBasePrivate &dd) |
void | loadPlugins (QObject *parent, KXMLGUIClient *parentGUIClient, const KAboutData &aboutData) |
void | loadPlugins (QObject *parent, KXMLGUIClient *parentGUIClient, const QString &parentInstanceName) |
virtual void | setComponentData (const KAboutData &componentData) |
virtual void | setComponentData (const KAboutData &pluginData, bool loadPlugins) |
void | setPluginInterfaceVersion (int version) |
void | setPluginLoadingMode (PluginLoadingMode loadingMode) |
![]() | |
void | loadStandardsXmlFile () |
virtual void | setComponentName (const QString &componentName, const QString &componentDisplayName) |
virtual void | setDOMDocument (const QDomDocument &document, bool merge=false) |
virtual void | setLocalXMLFile (const QString &file) |
virtual void | setXML (const QString &document, bool merge=false) |
virtual void | setXMLFile (const QString &file, bool merge=false, bool setXMLDoc=true) |
virtual void | stateChanged (const QString &newstate, ReverseStateChange reverse=StateNoReverse) |
Protected Attributes | |
const std::unique_ptr< PartBasePrivate > | d_ptr |
Additional Inherited Members | |
![]() | |
static QString | findVersionNumber (const QString &xml) |
![]() | |
static QString | standardsXmlFileLocation () |
Detailed Description
Base class for all parts.
Definition at line 38 of file partbase.h.
Member Enumeration Documentation
◆ PluginLoadingMode
|
protected |
We have three different policies, whether to load new plugins or not.
The value in the KConfig object of the KAboutData object always overrides LoadPlugins and LoadPluginsIfEnabled.
Definition at line 155 of file partbase.h.
Constructor & Destructor Documentation
◆ PartBase()
PartBase::PartBase | ( | ) |
Constructor.
Definition at line 16 of file partbase.cpp.
◆ ~PartBase()
|
overridedefault |
Destructor.
Member Function Documentation
◆ componentData()
KAboutData PartBase::componentData | ( | ) | const |
- Deprecated:
- Since 5.77, use Part::metaData() or KXMLGUIClient::componentName() instead.
Definition at line 43 of file partbase.cpp.
◆ loadPlugins() [1/2]
|
protected |
Load the Plugins honoring the PluginLoadingMode.
If you call this method in an already constructed GUI (like when the user has changed which plugins are enabled) you need to add the new plugins to the KXMLGUIFactory:
- Deprecated:
- Since 5.77, use loadPlugins(QObject *parent, KXMLGUIClient *, const QString &) instead.
Definition at line 82 of file partbase.cpp.
◆ loadPlugins() [2/2]
|
protected |
Load the Plugins honoring the PluginLoadingMode.
If you call this method in an already constructed GUI (like when the user has changed which plugins are enabled) you need to add the new plugins to the KXMLGUIFactory:
- Since
- 5.77
- Deprecated:
- Since 5.90, the concept of KPart plugins is deprecated, see docs of KParts::Plugin class
Definition at line 89 of file partbase.cpp.
◆ setComponentData() [1/2]
|
protectedvirtual |
Set the componentData(KAboutData) for this part.
Call this first in the inherited class constructor.
- Deprecated:
- Since 5.77, use Part::setMetaData(const KPluginMetaData&) or KXMLGUIClient::setComponentName(const QString &, const QString &) instead.
Definition at line 52 of file partbase.cpp.
◆ setComponentData() [2/2]
|
protectedvirtual |
Set the componentData(KAboutData) for this part.
Call this first in the inherited class constructor.
It is recommended to call setComponentData with loadPlugins set to false, and to load plugins at the end of your part constructor (in the case of KParts::MainWindow, plugins are automatically loaded in createGUI anyway, so set loadPlugins to false for KParts::MainWindow as well).
- Deprecated:
- Since 5.77, use Part::setMetaData(const KPluginMetaData&) or KXMLGUIClient::setComponentName(const QString &, const QString &) instead.
Definition at line 59 of file partbase.cpp.
◆ setPartObject()
void PartBase::setPartObject | ( | QObject * | object | ) |
Internal method.
Called by KParts::Part to specify the parent object for plugin objects.
Definition at line 28 of file partbase.cpp.
◆ setPluginInterfaceVersion()
|
protected |
If you change the binary interface offered by your part, you can avoid crashes from old plugins lying around by setting X-KDE-InterfaceVersion=2 in the .desktop files of the plugins, and calling setPluginInterfaceVersion( 2 ), so that the old plugins are not loaded.
Increase both numbers every time a binary incompatible change in the application's plugin interface is made.
- Parameters
-
version the interface version that plugins must have in order to be loaded.
For a KParts::Part: call this before setComponentData. For a KParts::MainWindow: call this before createGUI.
- Deprecated:
- Since 5.90, the concept of KPart plugins is deprecated, see docs of KParts::Plugin class
Definition at line 107 of file partbase.cpp.
◆ setPluginLoadingMode()
|
protected |
Set how plugins should be loaded.
- Parameters
-
loadingMode see PluginLoadingMode
For a KParts::Part: call this before setComponentData. For a KParts::MainWindow: call this before createGUI.
- Deprecated:
- Since 5.90, the concept of KPart plugins is deprecated, see docs of KParts::Plugin class
Definition at line 98 of file partbase.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Dec 5 2023 03:54:20 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.