# class PartBase

###

Module | kparts
Namespace | KParts
Class | PartBase
Inherits | KXMLGUIClient

Base class for all parts.

### enums

- PluginLoadingMode { DoNotLoadPlugins, LoadPlugins, LoadPluginsIfEnabled }

enum details

### methods

- PartBase ( )

  returns ctor

  Constructor.

- PartBase (dd)

  returns ctor
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  dd | PartBasePrivate |

- PartBase (a0)

  returns ctor
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  a0 | KParts.PartBase |

- loadPlugins (parent, parentGUIClient, componentData)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  parent | QObject |
  parentGUIClient | KXMLGUIClient |
  componentData | KComponentData |

  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:

      if( factory() )
      {
      QList<KParts.Plugin *> plugins = KParts.Plugin.pluginObjects( this );
      for(int i = 0; i != plugins.size(); ++i) {
      factory()->addClient( plugins[i] );
      }
      }

- partObject ( )

  returns QObject

- setComponentData (componentData)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  componentData | KComponentData |

  Set the componentData(KComponentData) for this part.

  Call this *first* in the inherited class constructor, because it loads the i18n catalogs.

- setComponentData (componentData, loadPlugins)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  componentData | KComponentData |
  loadPlugins | bool |

  Set the componentData(KComponentData) for this part.

  Call this *first* in the inherited class constructor, because it loads the i18n catalogs.

  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).

- setPartObject (object)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  object | QObject |

  Internal method. Called by KParts.Part to specify the parent object for plugin objects.

  Internal

- setPluginInterfaceVersion (version)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  version | int |

  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.

  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.

- setPluginLoadingMode (loadingMode)

  returns Nothing
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  loadingMode | KParts::PartBase.PluginLoadingMode |

  Set how plugins should be loaded

  loadingMode - see PluginLoadingMode

  For a KParts.Part: call this before setComponentData. For a KParts.MainWindow: call this before createGUI.

### enums - detail

- PluginLoadingMode { DoNotLoadPlugins, LoadPlugins, LoadPluginsIfEnabled }

  Don't load any plugins at all.

  | DoNotLoadPlugins | - 0 | - |
  | LoadPlugins | - 1 | - |
  | LoadPluginsIfEnabled | - 2 | - |