KParts
#include <part.h>

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 () |
![]() | |
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 ®Exp) 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 |
![]() | |
PartBase () | |
virtual | ~PartBase () |
QObject * | partObject () const |
void | setPartObject (QObject *object) |
![]() | |
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) |
![]() | |
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) |
![]() | |
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) |
![]() | |
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 | |
![]() | |
enum | ReverseStateChange |
![]() | |
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 QString | findMostRecentXMLFile (const QStringList &files, QString &doc) |
![]() | |
enum | PluginLoadingMode { DoNotLoadPlugins = 0, LoadPlugins = 1, LoadPluginsIfEnabled = 2 } |
![]() | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
![]() | |
PartBasePrivate * | d_ptr |
![]() | |
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.
Constructor & Destructor Documentation
|
explicit |
|
protected |
Member Function Documentation
|
protectedvirtual |
|
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.
|
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.
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
-
widget the part widget being clicked - usually the same as widget(), except in koffice. globalPos the mouse coordinates in global coordinates
Convenience method for KXMLGUIFactory::container.
- Returns
- a container widget owned by the Part's GUI.
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.
bool Part::isSelectable | ( | ) | const |
|
protected |
PartManager * Part::manager | ( | ) | const |
|
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.
|
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.
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.
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.
|
virtual |
|
virtual |
|
signal |
Emitted by the part, to set a text in the statusbar of the window(s) hosting this part.
|
protectedvirtual |
|
signal |
Emitted by the part, to set the caption of the window(s) hosting this part.
|
virtual |
- Returns
- The widget defined by this part, set by setWidget().
The documentation for this class was generated from the following files:
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.