• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KParts

  • KParts
  • Part
Signals | Public Member Functions | Protected Slots | Protected Member Functions | List of all members
KParts::Part Class Reference

#include <part.h>

Inheritance diagram for KParts::Part:
Inheritance graph
[legend]

Signals

void setStatusBarText (const QString &text)
 
void setWindowCaption (const QString &caption)
 

Public Member Functions

 Part (QObject *parent=0)
 
virtual ~Part ()
 
virtual void embed (QWidget *parentWidget)
 
virtual Part * hitTest (QWidget *widget, const QPoint &globalPos)
 
KIconLoader * iconLoader ()
 
bool isSelectable () const
 
PartManager * manager () const
 
void setAutoDeletePart (bool autoDeletePart)
 
void setAutoDeleteWidget (bool autoDeleteWidget)
 
virtual void setManager (PartManager *manager)
 
virtual void setSelectable (bool selectable)
 
virtual QWidget * widget ()
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual  ~QObject ()
 
bool blockSignals (bool block)
 
QObject * child (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArray > dynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
T findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObject * metaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObject * parent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThread * thread () const
 
- Public Member Functions inherited from KParts::PartBase
 PartBase ()
 
virtual ~PartBase ()
 
QObject * partObject () const
 
void setPartObject (QObject *object)
 
- Public Member Functions inherited from KXMLGUIClient
 KXMLGUIClient ()
 
 KXMLGUIClient (KXMLGUIClient *parent)
 
virtual ~KXMLGUIClient ()
 
QAction * action (const char *name) const
 
virtual QAction * action (const QDomElement &element) const
 
virtual KActionCollection * actionCollection () const
 
void addStateActionDisabled (const QString &state, const QString &action)
 
void addStateActionEnabled (const QString &state, const QString &action)
 
void beginXMLPlug (QWidget *)
 
QList< KXMLGUIClient * > childClients ()
 
KXMLGUIBuilder * clientBuilder () const
 
virtual KComponentData componentData () const
 
virtual QDomDocument domDocument () const
 
void endXMLPlug ()
 
KXMLGUIFactory * factory () const
 
StateChange getActionsToChangeForState (const QString &state)
 
void insertChildClient (KXMLGUIClient *child)
 
virtual QString localXMLFile () const
 
KXMLGUIClient * parentClient () const
 
void plugActionList (const QString &name, const QList< QAction * > &actionList)
 
void prepareXMLUnplug (QWidget *)
 
void reloadXML ()
 
void removeChildClient (KXMLGUIClient *child)
 
void replaceXMLFile (const QString &xmlfile, const QString &localxmlfile, bool merge=false)
 
void setClientBuilder (KXMLGUIBuilder *builder)
 
void setFactory (KXMLGUIFactory *factory)
 
void setXMLGUIBuildDocument (const QDomDocument &doc)
 
void unplugActionList (const QString &name)
 
virtual QString xmlFile () const
 
QDomDocument xmlguiBuildDocument () const
 

Protected Slots

void slotWidgetDestroyed ()
 

Protected Member Functions

 Part (PartPrivate &dd, QObject *parent)
 
virtual void customEvent (QEvent *event)
 
virtual void guiActivateEvent (GUIActivateEvent *event)
 
QWidget * hostContainer (const QString &containerName)
 
void loadPlugins ()
 
virtual void partActivateEvent (PartActivateEvent *event)
 
virtual void partSelectEvent (PartSelectEvent *event)
 
virtual void setWidget (QWidget *widget)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 
- Protected Member Functions inherited from KParts::PartBase
 PartBase (PartBasePrivate &dd)
 
void loadPlugins (QObject *parent, KXMLGUIClient *parentGUIClient, const KComponentData &componentData)
 
virtual void setComponentData (const KComponentData &componentData)
 
virtual void setComponentData (const KComponentData &componentData, bool loadPlugins)
 
void setPluginInterfaceVersion (int version)
 
void setPluginLoadingMode (PluginLoadingMode loadingMode)
 
- Protected Member Functions inherited from KXMLGUIClient
void loadStandardsXmlFile ()
 
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)
 
virtual void virtual_hook (int id, void *data)
 

Additional Inherited Members

- Public Types inherited from KXMLGUIClient
enum  ReverseStateChange
 
- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Static Public Member Functions inherited from KXMLGUIClient
static QString findMostRecentXMLFile (const QStringList &files, QString &doc)
 
- Protected Types inherited from KParts::PartBase
enum  PluginLoadingMode { DoNotLoadPlugins = 0, LoadPlugins = 1, LoadPluginsIfEnabled = 2 }
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Protected Attributes inherited from KParts::PartBase
PartBasePrivate * d_ptr
 
- Properties inherited from QObject
 objectName
 

Detailed Description

Base class for parts.

A "part" is a GUI component, featuring:

  • A widget embeddedable in any application.
  • GUI elements that will be merged in the "host" user interface (menubars, toolbars... ).

About the widget:
Note that KParts::Part does not inherit QWidget. This is due to the fact that the "visual representation" will probably not be a mere QWidget, but an elaborate one. That's why when implementing your KParts::Part (or derived) you should call KParts::Part::setWidget() in your constructor.

About the GUI elements:
Those elements trigger actions, defined by the part ( action()). The layout of the actions in the GUI is defined by an XML file ( setXMLFile()).

See also ReadOnlyPart and ReadWritePart, which define the framework for a "viewer" part and for an "editor"-like part. Use Part directly only if your part doesn't fit into those.

Definition at line 215 of file part.h.

Constructor & Destructor Documentation

Part::Part ( QObject *  parent = 0)
explicit

Constructor.

Parameters
parentParent object of the part.

Definition at line 178 of file part.cpp.

Part::~Part ( )
virtual

Destructor.

Definition at line 190 of file part.cpp.

Part::Part ( PartPrivate &  dd,
QObject *  parent 
)
protected

Definition at line 184 of file part.cpp.

Member Function Documentation

void Part::customEvent ( QEvent *  event)
protectedvirtual

Reimplemented from QObject.

Definition at line 303 of file part.cpp.

void Part::embed ( QWidget *  parentWidget)
virtual

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.

Definition at line 215 of file part.cpp.

void Part::guiActivateEvent ( GUIActivateEvent *  event)
protectedvirtual

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.

Reimplemented in KParts::ReadOnlyPart.

Definition at line 334 of file part.cpp.

Part * Part::hitTest ( QWidget *  widget,
const QPoint &  globalPos 
)
virtual

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)

Parameters
widgetthe part widget being clicked - usually the same as widget(), except in koffice.
globalPosthe mouse coordinates in global coordinates

Definition at line 271 of file part.cpp.

QWidget * Part::hostContainer ( const QString &  containerName)
protected

Convenience method for KXMLGUIFactory::container.

Returns
a container widget owned by the Part's GUI.

Definition at line 338 of file part.cpp.

KIconLoader * Part::iconLoader ( )

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.

Definition at line 246 of file part.cpp.

bool Part::isSelectable ( ) const

Returns whether the part is selectable or not.

Definition at line 296 of file part.cpp.

void Part::loadPlugins ( )
protected

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

Definition at line 357 of file part.cpp.

PartManager * Part::manager ( ) const

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

Definition at line 264 of file part.cpp.

void Part::partActivateEvent ( PartActivateEvent *  event)
protectedvirtual

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.

Definition at line 326 of file part.cpp.

void Part::partSelectEvent ( PartSelectEvent *  event)
protectedvirtual

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.

Definition at line 330 of file part.cpp.

void Part::setAutoDeletePart ( bool  autoDeletePart)

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.

Definition at line 238 of file part.cpp.

void Part::setAutoDeleteWidget ( bool  autoDeleteWidget)

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.

Definition at line 232 of file part.cpp.

void Part::setManager ( PartManager *  manager)
virtual

Used by the part manager.

Definition at line 257 of file part.cpp.

void Part::setSelectable ( bool  selectable)
virtual
Parameters
selectableIndicates whether the part is selectable or not.

Definition at line 289 of file part.cpp.

void KParts::Part::setStatusBarText ( const QString &  text)
signal

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

void Part::setWidget ( QWidget *  widget)
protectedvirtual

Set the main widget.

Call this in the Part-inherited class constructor.

Definition at line 281 of file part.cpp.

void KParts::Part::setWindowCaption ( const QString &  caption)
signal

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

void Part::slotWidgetDestroyed ( )
protectedslot

Definition at line 346 of file part.cpp.

QWidget * Part::widget ( )
virtual
Returns
The widget defined by this part, set by setWidget().

Definition at line 225 of file part.cpp.


The documentation for this class was generated from the following files:
  • part.h
  • part.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:25:36 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KParts

Skip menu "KParts"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal