KDEUI
KActionCategory Class Reference
Categorize actions for KShortcutsEditor. More...
#include <kactioncategory.h>

Public Member Functions | |
const QList< QAction * > | actions () const |
KActionCollection * | collection () const |
KActionCategory (const QString &text, KActionCollection *parent=NULL) | |
void | setText (const QString &text) |
QString | text () const |
virtual | ~KActionCategory () |
Adding Actions | |
Add a action to the category.
This methods are provided for your convenience. They call the corresponding method of KActionCollection. | |
template<class ActionType > | |
ActionType * | add (const QString &name, const QObject *receiver=NULL, const char *member=NULL) |
KAction * | addAction (const QString &name, const QObject *receiver=NULL, const char *member=NULL) |
KAction * | addAction (KStandardAction::StandardAction actionType, const QString &name, const QObject *receiver=NULL, const char *member=NULL) |
KAction * | addAction (KStandardAction::StandardAction actionType, const QObject *receiver=NULL, const char *member=NULL) |
KAction * | addAction (const QString &name, KAction *action) |
QAction * | addAction (const QString &name, QAction *action) |
Properties | |
QString | text |
Detailed Description
Categorize actions for KShortcutsEditor.KActionCategory provides a second level to organize the actions in KShortcutsEditor.
The first possibility is using more than one action collection. Each actions collection becomes a top level node.
+ action collection 1 + first action + second action + third action + action collection 2 + first action + second action + third action
Using KActionCategory it's possible to group the actions of one collection. + action collection 1 + first action + first category + action 1 in category + action 2 in category + second action
Usage
The usage is analog to action collections. Just create a category and use it instead of the collection to create the actions.The synchronization between KActionCollection and KActionCategory is done internally. There is for example no need to remove actions from a category. It is done implicitely if the action is removed from the associated collection.
KActionCategory *file = new KActionCategory(i18n("File"), actionCollection()); file->addAction( KStandardAction::New, //< see KStandardAction this, //< Receiver SLOT(fileNew())); //< SLOT ... more actions added to file ... KActionCategory *edit = new KActionCategory(i18n("Edit"), actionCollection()); edit->addAction( KStandardAction::Copy, //< see KStandardAction this, //< Receiver SLOT(fileNew())); //< SLOT ...
Definition at line 95 of file kactioncategory.h.
Constructor & Destructor Documentation
KActionCategory::KActionCategory | ( | const QString & | text, | |
KActionCollection * | parent = NULL | |||
) | [explicit] |
KActionCategory::~KActionCategory | ( | ) | [virtual] |
Member Function Documentation
ActionType* KActionCategory::add | ( | const QString & | name, | |
const QObject * | receiver = NULL , |
|||
const char * | member = NULL | |||
) | [inline] |
Definition at line 143 of file kactioncategory.h.
KAction * KActionCategory::addAction | ( | const QString & | name, | |
const QObject * | receiver = NULL , |
|||
const char * | member = NULL | |||
) |
Definition at line 102 of file kactioncategory.cpp.
KAction * KActionCategory::addAction | ( | KStandardAction::StandardAction | actionType, | |
const QString & | name, | |||
const QObject * | receiver = NULL , |
|||
const char * | member = NULL | |||
) |
Definition at line 90 of file kactioncategory.cpp.
KAction * KActionCategory::addAction | ( | KStandardAction::StandardAction | actionType, | |
const QObject * | receiver = NULL , |
|||
const char * | member = NULL | |||
) |
Definition at line 79 of file kactioncategory.cpp.
Definition at line 71 of file kactioncategory.cpp.
Definition at line 63 of file kactioncategory.cpp.
KActionCollection * KActionCategory::collection | ( | ) | const |
The action collection this category is associated with.
Definition at line 123 of file kactioncategory.cpp.
void KActionCategory::setText | ( | const QString & | text | ) |
QString KActionCategory::text | ( | ) | const |
The action categorys descriptive text.
Property Documentation
QString KActionCategory::text [read, write] |
Definition at line 99 of file kactioncategory.h.
The documentation for this class was generated from the following files: