KParts
KParts::Part Class Reference
Base class for parts. More...
#include <part.h>
Signals | |
void | setStatusBarText (const QString &text) |
void | setWindowCaption (const QString &caption) |
Public Member Functions | |
virtual void | embed (QWidget *parentWidget) |
virtual Part * | hitTest (QWidget *widget, const QPoint &globalPos) |
bool | isSelectable () const |
PartManager * | manager () const |
Part (QObject *parent=0, const char *name=0) | |
virtual void | setManager (PartManager *manager) |
virtual void | setSelectable (bool selectable) |
virtual QWidget * | widget () |
virtual | ~Part () |
Protected Member Functions | |
virtual void | customEvent (QCustomEvent *event) |
virtual void | guiActivateEvent (GUIActivateEvent *event) |
QWidget * | hostContainer (const QString &containerName) |
virtual void | partActivateEvent (PartActivateEvent *event) |
virtual void | partSelectEvent (PartSelectEvent *event) |
virtual void | setWidget (QWidget *widget) |
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... ).
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 181 of file part.h.
Constructor & Destructor Documentation
Part::Part | ( | QObject * | parent = 0 , |
|
const char * | name = 0 | |||
) |
Member Function Documentation
void Part::customEvent | ( | QCustomEvent * | event | ) | [protected, virtual] |
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.
void Part::guiActivateEvent | ( | GUIActivateEvent * | event | ) | [protected, virtual] |
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.
bool Part::isSelectable | ( | ) | const |
PartManager * Part::manager | ( | ) | const |
void Part::partActivateEvent | ( | PartActivateEvent * | event | ) | [protected, virtual] |
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.
void Part::partSelectEvent | ( | PartSelectEvent * | event | ) | [protected, virtual] |
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::setManager | ( | PartManager * | manager | ) | [virtual] |
void Part::setSelectable | ( | bool | selectable | ) | [virtual] |
void KParts::Part::setStatusBarText | ( | const QString & | text | ) | [signal] |
Emited by the part, to set a text in the statusbar of the window(s) hosting this part.
void Part::setWidget | ( | QWidget * | widget | ) | [protected, virtual] |
void KParts::Part::setWindowCaption | ( | const QString & | caption | ) | [signal] |
Emitted by the part, to set the caption of the window(s) hosting this part.
QWidget * Part::widget | ( | ) | [virtual] |
- Returns:
- The widget defined by this part, set by setWidget().
The documentation for this class was generated from the following files: