• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

KActionCategory Class Reference

Categorize actions for KShortcutsEditor. More...

#include <kactioncategory.h>

Inheritance diagram for KActionCategory:

Inheritance graph
[legend]

List of all members.


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]

Default constructor.

Definition at line 43 of file kactioncategory.cpp.

KActionCategory::~KActionCategory (  )  [virtual]

Destructor.

Definition at line 51 of file kactioncategory.cpp.


Member Function Documentation

const QList< QAction * > KActionCategory::actions (  )  const

Returns the actions belonging to this category.

Definition at line 57 of file kactioncategory.cpp.

template<class ActionType >
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.

KAction * KActionCategory::addAction ( const QString &  name,
KAction *  action 
)

Definition at line 71 of file kactioncategory.cpp.

QAction * KActionCategory::addAction ( const QString &  name,
QAction *  action 
)

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  ) 

Set the action categorys descriptive text.

Definition at line 135 of file kactioncategory.cpp.

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:
  • kactioncategory.h
  • kactioncategory.cpp

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal