Kross::ActionCollection

Kross::ActionCollection Class Reference

#include <actioncollection.h>

Inheritance diagram for Kross::ActionCollection:

Signals

void actionInserted (Action *child, ActionCollection *parent)
 
void actionRemoved (Action *child, ActionCollection *parent)
 
void actionToBeInserted (Action *child, ActionCollection *parent)
 
void actionToBeRemoved (Action *child, ActionCollection *parent)
 
void collectionInserted (ActionCollection *child, ActionCollection *parent)
 
void collectionRemoved (ActionCollection *child, ActionCollection *parent)
 
void collectionToBeInserted (ActionCollection *child, ActionCollection *parent)
 
void collectionToBeRemoved (ActionCollection *child, ActionCollection *parent)
 
void dataChanged (Action *)
 
void dataChanged (ActionCollection *)
 
void updated ()
 

Public Member Functions

 ActionCollection (const QString &name, ActionCollection *parent=nullptr)
 
virtual ~ActionCollection ()
 
Actionaction (const QString &name) const
 
QList< Action * > actions () const
 
void addAction (Action *action)
 
void addAction (const QString &name, Action *action)
 
ActionCollectioncollection (const QString &name) const
 
QStringList collections () const
 
QString description () const
 
bool hasCollection (const QString &name) const
 
QIcon icon () const
 
QString iconName () const
 
bool isEnabled () const
 
QString name () const
 
ActionCollectionparentCollection () const
 
bool readXml (const QDomElement &element, const QDir &directory=QDir())
 
bool readXml (const QDomElement &element, const QStringList &searchPath)
 
bool readXml (QIODevice *device, const QDir &directory=QDir())
 
bool readXml (QIODevice *device, const QStringList &searchPath)
 
bool readXmlFile (const QString &file)
 
void removeAction (const QString &name)
 
void removeAction (Action *action)
 
void setDescription (const QString &description)
 
void setEnabled (bool enabled)
 
void setIconName (const QString &iconname)
 
void setParentCollection (ActionCollection *parent)
 
void setText (const QString &text)
 
QString text () const
 
QDomElement writeXml ()
 
QDomElement writeXml (const QStringList &searchPath)
 
bool writeXml (QIODevice *device, int indent=2)
 
bool writeXml (QIODevice *device, int indent, const QStringList &searchPath)
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
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 ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
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 QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
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_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 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
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
qobject_cast (QObject *object)
 
qobject_cast (const QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 

Protected Member Functions

void connectSignals (ActionCollection *collection, bool conn)
 
void connectSignals (Action *collection, bool conn)
 
void registerCollection (ActionCollection *collection)
 
void unregisterCollection (const QString &name)
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
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)
 

Additional Inherited Members

- 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 *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
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, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction 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)
 
- Public Attributes inherited from QObject
typedef QObjectList
 

Detailed Description

The ActionCollection class manages collections of Action instances.

An ActionCollection can have both actions and other collections as children. Child actions can be accessed using actions() which returns a list of Action pointers. Child collections can be accessed using collections() which returns a list of collection names. The collection can then be accessed with collection(name). To add a child action, call addAction(), and to remove an action: removeAction(). To add a child collection, call setParentCollection(parent) in the collection you want to add to parent. To remove a collection call setParentCollection(0). NOTE: Do not use setParent().

Definition at line 46 of file actioncollection.h.

Constructor & Destructor Documentation

ActionCollection::ActionCollection ( const QString name,
ActionCollection parent = nullptr 
)
explicit

Constructor.

Parameters
nameThe objectName the ActionCollection has.
parentThe parent ActionCollection this ActionCollection will be child of. If parent is not NULL, this ActionCollection instance will register itself as child of the parent parent by using the setParentCollection method.

Definition at line 62 of file actioncollection.cpp.

ActionCollection::~ActionCollection ( )
virtual

Destructor.

Definition at line 74 of file actioncollection.cpp.

Member Function Documentation

Action * ActionCollection::action ( const QString name) const
Returns
action with given name or 0 if it wasn't found

Definition at line 206 of file actioncollection.cpp.

void Kross::ActionCollection::actionInserted ( Action child,
ActionCollection parent 
)
signal

This signal is emitted after child has been added to parent.

void Kross::ActionCollection::actionRemoved ( Action child,
ActionCollection parent 
)
signal

This signal is emitted after child has been removed from parent.

void Kross::ActionCollection::actionToBeInserted ( Action child,
ActionCollection parent 
)
signal

This signal is emitted just before child is added to parent.

void Kross::ActionCollection::actionToBeRemoved ( Action child,
ActionCollection parent 
)
signal

This signal is emitted before child is removed from parent.

ActionCollection * ActionCollection::collection ( const QString name) const
Returns
the ActionCollection instance which objectName is name or NULL if there exists no such ActionCollection .

Definition at line 166 of file actioncollection.cpp.

void Kross::ActionCollection::collectionInserted ( ActionCollection child,
ActionCollection parent 
)
signal

This signal is emitted after child has been added to parent.

void Kross::ActionCollection::collectionRemoved ( ActionCollection child,
ActionCollection parent 
)
signal

This signal is emitted after child has been removed from parent.

QStringList ActionCollection::collections ( ) const
Returns
a list of names of child ActionCollection instances this collection has

Definition at line 171 of file actioncollection.cpp.

void Kross::ActionCollection::collectionToBeInserted ( ActionCollection child,
ActionCollection parent 
)
signal

This signal is emitted just before child is added to parent.

void Kross::ActionCollection::collectionToBeRemoved ( ActionCollection child,
ActionCollection parent 
)
signal

This signal is emitted before child is removed from parent.

void Kross::ActionCollection::dataChanged ( Action )
signal

This signal is emitted when the data of a child action is changed.

void Kross::ActionCollection::dataChanged ( ActionCollection )
signal

This signal is emitted when the data of the ActionCollection is changed.

QString ActionCollection::description ( ) const
Returns
the optional description for this ActionCollection.

Definition at line 100 of file actioncollection.cpp.

bool ActionCollection::hasCollection ( const QString name) const
Returns
true if this collection has a child ActionCollection instance which objectName is name .

Definition at line 161 of file actioncollection.cpp.

QIcon ActionCollection::icon ( ) const
Returns
the icon defined with setIconName() .

Definition at line 120 of file actioncollection.cpp.

QString ActionCollection::iconName ( ) const
Returns
the name of the icon.

Definition at line 111 of file actioncollection.cpp.

bool ActionCollection::isEnabled ( ) const

Return the enable this ActionCollection has.

Definition at line 125 of file actioncollection.cpp.

QString ActionCollection::name ( ) const
Returns
the objectName for this ActionCollection.

Definition at line 84 of file actioncollection.cpp.

ActionCollection * ActionCollection::parentCollection ( ) const
Returns
the parent ActionCollection instance this is child of or NULL if this collection does not have a parent.

Definition at line 136 of file actioncollection.cpp.

bool ActionCollection::readXml ( const QDomElement element,
const QDir directory = QDir() 
)

Load child Action and ActionCollection instances this collection has from the element .

Parameters
elementThe QDomElement that contains the XML.
directoryThe current directory used for relative paths defined within a script-tag for the file-attribute. If the directory is QDir() relative paths are not resolved.
Returns
true on success else false.

Definition at line 313 of file actioncollection.cpp.

bool ActionCollection::readXml ( QIODevice device,
const QDir directory = QDir() 
)

Read XML from the QIODevice device .

Definition at line 387 of file actioncollection.cpp.

bool ActionCollection::readXmlFile ( const QString file)

Read the XML from the file file .

Parameters
fileThe existing XML file that should be read.
Returns
true if reading was successful else false.

Definition at line 408 of file actioncollection.cpp.

void ActionCollection::setDescription ( const QString description)

Set the optional description for this ActionCollection.

Definition at line 104 of file actioncollection.cpp.

void ActionCollection::setEnabled ( bool  enabled)

Enable or disable this ActionCollection.

Definition at line 129 of file actioncollection.cpp.

void ActionCollection::setIconName ( const QString iconname)

Set the name of the icon to iconname .

Definition at line 115 of file actioncollection.cpp.

void ActionCollection::setParentCollection ( ActionCollection parent)

Set the parent to parent. NOTE: Do not use setParent().

Definition at line 141 of file actioncollection.cpp.

void ActionCollection::setText ( const QString text)

Set the display text to text .

Definition at line 93 of file actioncollection.cpp.

QString ActionCollection::text ( ) const
Returns
the display text

Definition at line 89 of file actioncollection.cpp.

void Kross::ActionCollection::updated ( )
signal

This signal is emitted if the content of the ActionCollection was changed.

QDomElement ActionCollection::writeXml ( )
Returns
a QDomElement that represents the child Action and ActionCollection instances this collection has.

Definition at line 437 of file actioncollection.cpp.

bool ActionCollection::writeXml ( QIODevice device,
int  indent = 2 
)

Write XML to the QIODevice device and use a space-idention of indent for the XML.

Definition at line 492 of file actioncollection.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Aug 4 2020 22:57:58 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.