KParts::Part Class Reference
Base class for parts. More...
#include <part.h>
Inheritance diagram for KParts::Part:


Signals | |
void | setWindowCaption (const QString &caption) |
Emitted by the part, to set the caption of the window(s) hosting this part. | |
void | setStatusBarText (const QString &text) |
Emited by the part, to set a text in the statusbar of the window(s) hosting this part. | |
Public Member Functions | |
Part (QObject *parent=0, const char *name=0) | |
Constructor. | |
virtual | ~Part () |
Destructor. | |
virtual void | embed (QWidget *parentWidget) |
Embed this part into a host widget. | |
virtual QWidget * | widget () |
virtual void | setManager (PartManager *manager) |
PartManager * | manager () const |
Returns the part manager handling this part, if any (0L otherwise). | |
virtual Part * | hitTest (QWidget *widget, const QPoint &globalPos) |
virtual void | setSelectable (bool selectable) |
bool | isSelectable () const |
Returns whether the part is selectable or not. | |
Protected Member Functions | |
virtual void | setWidget (QWidget *widget) |
Set the main widget. | |
virtual void | customEvent (QCustomEvent *event) |
virtual void | partActivateEvent (PartActivateEvent *event) |
Convenience method which is called when the Part received a PartActivateEvent . | |
virtual void | partSelectEvent (PartSelectEvent *event) |
Convenience method which is called when the Part received a PartSelectEvent . | |
virtual void | guiActivateEvent (GUIActivateEvent *event) |
Convenience method which is called when the Part received a GUIActivateEvent . | |
QWidget * | hostContainer (const QString &containerName) |
Convenience method for KXMLGUIFactory::container. |
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 142 of file part.h.
Constructor & Destructor Documentation
|
Constructor.
Definition at line 131 of file part.cpp. References KStdAccel::name(). |
|
Destructor.
Definition at line 140 of file part.cpp. References QObject::destroyed(), QObject::disconnect(), and KParts::PartManager::removePart(). |
Member Function Documentation
|
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 163 of file part.cpp. References QWidget::reparent(), and widget(). |
|
Definition at line 169 of file part.cpp. Referenced by KParts::PartManager::addPart(), embed(), KParts::ReadWritePart::queryClose(), KParts::PartManager::setActivePart(), and KParts::PartManager::setSelectedPart(). |
|
Returns the part manager handling this part, if any (0L otherwise).
|
|
|
|
Returns whether the part is selectable or not.
|
|
Emitted by the part, to set the caption of the window(s) hosting this part.
Referenced by KParts::ReadOnlyPart::guiActivateEvent(), KParts::ReadOnlyPart::openURL(), and KParts::ReadWritePart::saveAs(). |
|
Emited by the part, to set a text in the statusbar of the window(s) hosting this part.
|
|
Set the main widget. Call this in the Part-inherited class constructor. Definition at line 192 of file part.cpp. References KXMLGUIClient::actionCollection(), QObject::connect(), QObject::destroyed(), KActionCollection::setAutoConnectShortcuts(), and KActionCollection::setWidget(). |
|
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. |
|
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. |
|
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. |
|
Convenience method for KXMLGUIFactory::container.
Definition at line 254 of file part.cpp. References KXMLGUIFactory::container(), and KXMLGUIClient::factory(). |
The documentation for this class was generated from the following files: