KParts::Part

Search for usage in LXR

#include <KParts/Part>

Inheritance diagram for KParts::Part:

Signals

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

Public Member Functions

 Part (QObject *parent=nullptr, const KPluginMetaData &data={})
 
 ~Part () override
 
virtual ParthitTest (QWidget *widget, const QPoint &globalPos)
 
PartManagermanager () const
 
KPluginMetaData metaData () const
 
void setAutoDeletePart (bool autoDeletePart)
 
void setAutoDeleteWidget (bool autoDeleteWidget)
 
virtual void setManager (PartManager *manager)
 
virtual QWidgetwidget ()
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
QBindable< QStringbindableObjectName ()
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo () const const
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isQuickItemType () const const
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_GADGET_EXPORT (EXPORT_MACRO)
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setObjectName (QAnyStringView name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool setProperty (const char *name, QVariant &&value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType)
 
QThreadthread () const const
 
- Public Member Functions inherited from KParts::PartBase
 PartBase ()
 
 ~PartBase () override
 
QObjectpartObject () const
 
void setPartObject (QObject *object)
 
- Public Member Functions inherited from KXMLGUIClient
 KXMLGUIClient (KXMLGUIClient *parent)
 
virtual QActionaction (const QDomElement &element) const
 
QActionaction (const QString &name) const
 
virtual KActionCollectionactionCollection () const
 
QList< KXMLGUIClient * > childClients ()
 
KXMLGUIBuilderclientBuilder () const
 
virtual QString componentName () const
 
virtual QDomDocument domDocument () const
 
KXMLGUIFactoryfactory () const
 
void insertChildClient (KXMLGUIClient *child)
 
KXMLGUIClientparentClient () const
 
void plugActionList (const QString &name, const QList< QAction * > &actionList)
 
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

KPARTS_NO_EXPORT Part (PartPrivate &dd, QObject *parent)
 
void customEvent (QEvent *event) override
 
virtual void guiActivateEvent (GUIActivateEvent *event)
 
QWidgethostContainer (const QString &containerName)
 
virtual void partActivateEvent (PartActivateEvent *event)
 
virtual void setWidget (QWidget *widget)
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 
- Protected Member Functions inherited from KParts::PartBase
KPARTS_NO_EXPORT PartBase (PartBasePrivate &dd)
 
- Protected Member Functions inherited from KXMLGUIClient
void loadStandardsXmlFile ()
 
virtual void setComponentName (const QString &componentName, const QString &componentDisplayName)
 
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)
 

Additional Inherited Members

- Public Types inherited from QObject
typedef  QObjectList
 
- Properties inherited from QObject
 objectName
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
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)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
- Static Public Member Functions inherited from KXMLGUIClient
static QString findVersionNumber (const QString &xml)
 
- Static Protected Member Functions inherited from KXMLGUIClient
static QString standardsXmlFileLocation ()
 
- Protected Attributes inherited from KParts::PartBase
std::unique_ptr< PartBasePrivate > const d_ptr
 

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 56 of file part.h.

Constructor & Destructor Documentation

◆ Part() [1/2]

Part::Part ( QObject * parent = nullptr,
const KPluginMetaData & data = {} )
explicit

Constructor.

Parameters
parentParent object of the part.
dataKPluginMetaData associated with this part, see Part::metaData()

Definition at line 23 of file part.cpp.

◆ ~Part()

Part::~Part ( )
override

Destructor.

Definition at line 40 of file part.cpp.

◆ Part() [2/2]

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

Definition at line 28 of file part.cpp.

Member Function Documentation

◆ customEvent()

void Part::customEvent ( QEvent * event)
overrideprotectedvirtual

Reimplemented from QObject.

Definition at line 119 of file part.cpp.

◆ guiActivateEvent()

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 138 of file part.cpp.

◆ hitTest()

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 101 of file part.cpp.

◆ hostContainer()

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 142 of file part.cpp.

◆ manager()

PartManager * Part::manager ( ) const

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

Definition at line 94 of file part.cpp.

◆ metaData()

KPluginMetaData Part::metaData ( ) const
Since
5.77

Definition at line 80 of file part.cpp.

◆ partActivateEvent()

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 134 of file part.cpp.

◆ setAutoDeletePart()

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 74 of file part.cpp.

◆ setAutoDeleteWidget()

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 68 of file part.cpp.

◆ setManager()

void Part::setManager ( PartManager * manager)
virtual

Used by the part manager.

Definition at line 87 of file part.cpp.

◆ setStatusBarText

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.

◆ setWidget()

void Part::setWidget ( QWidget * widget)
protectedvirtual

Set the main widget.

Call this in the Part-inherited class constructor.

Definition at line 112 of file part.cpp.

◆ setWindowCaption

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

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

Note
this signal has only an effect on the window title if window title handling is enabled
See also
KParts::MainWindow::setWindowTitleHandling

◆ slotWidgetDestroyed

void Part::slotWidgetDestroyed ( )
protectedslot

Definition at line 151 of file part.cpp.

◆ widget()

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

Reimplemented in KTextEditor::DocumentPrivate.

Definition at line 61 of file part.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:47:07 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.