# class Part

###

Module | kparts
Namespace | KParts
Class | Part
Inherits | QObject,KParts::PartBase

### methods

- Part (parent)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  parent | QObject | 0

  Constructor.

  parent - Parent object of the part.

- Part (dd, parent)

  returns ctor
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  dd | PartPrivate |
  parent | QObject |

- Part (a0)

  returns ctor
  Not implemented

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

- Part (a0)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | QObject | 0

- customEvent (event)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  event | QEvent |

  Internal

- embed (parentWidget)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  parentWidget | QWidget |

  Embed this part into a host widget.

  You don't need to do this if you created the widget with the correct parent widget - this is just a QWidget.reparent(). Note that the Part is still the holder of the QWidget, meaning that if you delete the Part, then the widget gets destroyed as well, and vice-versa. This method is not recommended since creating the widget with the correct parent is simpler anyway.

- guiActivateEvent (event)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  event | KParts.GUIActivateEvent |

  Convenience method which is called when the Part received a GUIActivateEvent . Reimplement this if you don't want to reimplement event and test for the event yourself or even install an event filter.

- hitTest (widget, globalPos)

  returns KParts.Part

  Argument | Type | Default
  --- | --- | ---
  widget | QWidget |
  globalPos | QPoint |

  Returns the part (this, or a child part) at the given global position. This is called by the part manager to ask whether a part should be activated when clicking somewhere. In most cases the default implementation is enough. Reimplement this if your part has child parts in some areas (like in khtml or koffice)

  widget - the part widget being clicked - usually the same as widget(), except in koffice.

  globalPos - the mouse coordinates in global coordinates

- hostContainer (containerName)

  returns QWidget

  Argument | Type | Default
  --- | --- | ---
  containerName | QString |

  Convenience method for KXMLGUIFactory.container. Returns a container widget owned by the Part's GUI.

- iconLoader ( )

  returns KIconLoader

  Use this icon loader to load any icons that are specific to this part, i.e. icons installed into this part's own directories as opposed to standard kde icons. Use KIcon("myicon", iconLoader()).

  Make sure to call setComponentData before calling iconLoader.

- isSelectable ( )

  returns bool

  Returns whether the part is selectable or not.

- loadPlugins ( )

  returns Nothing
  KDE 4.1.0 and later only

  Load this part's plugins now. Normally you want to call this at the end of the part constructor, if you used setComponentData(componentData, false) @since 4.1

- manager ( )

  returns KParts.PartManager

  Returns the part manager handling this part, if any (0 otherwise).

- partActivateEvent (event)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  event | KParts.PartActivateEvent |

  Convenience method which is called when the Part received a PartActivateEvent . Reimplement this if you don't want to reimplement event and test for the event yourself or even install an event filter.

- partSelectEvent (event)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  event | KParts.PartSelectEvent |

  Convenience method which is called when the Part received a PartSelectEvent . Reimplement this if you don't want to reimplement event and test for the event yourself or even install an event filter.

- setAutoDeletePart (autoDeletePart)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  autoDeletePart | bool |

  By default, the part deletes itself when its widget is deleted. The hosting application can call setAutoDeletePart(false) to disable this behavior, to be able to delete the widget and then the part, independently. This is a method for the hosting application only, Part subclasses should never call this.

- setAutoDeleteWidget (autoDeleteWidget)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  autoDeleteWidget | bool |

  By default, the widget is deleted by the part when the part is deleted. The hosting application can call setAutoDeleteWidget(false) to disable this behavior, given that the widget is usually deleted by its parent widget anyway. This is a method for the hosting application only, Part subclasses should never call this.

- setManager (manager)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  manager | KParts.PartManager |

  Internal Used by the part manager.

- setSelectable (selectable)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  selectable | bool |

  selectable - Indicates whether the part is selectable or not.

- setStatusBarText (text)

  returns Nothing
  SIGNAL ("setStatusBarText (const QString&)")

  Argument | Type | Default
  --- | --- | ---
  text | QString |

  Emited by the part, to set a text in the statusbar of the window(s) hosting this part

- setWidget (widget)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  widget | QWidget |

  Set the main widget.

  Call this in the Part-inherited class constructor.

- setWindowCaption (caption)

  returns Nothing
  SIGNAL ("setWindowCaption (const QString&)")

  Argument | Type | Default
  --- | --- | ---
  caption | QString |

  Emitted by the part, to set the caption of the window(s) hosting this part

- slotWidgetDestroyed ( )

  returns Nothing

  Internal

- widget ( )

  returns QWidget

  Returns The widget defined by this part, set by setWidget().