|
Signals |
| void | keycodeChanged () |
Public Methods |
| | KAccel (QWidget *pParent, const char *psName=0) |
| | KAccel (QWidget *watch, QObject *parent, const char *psName=0) |
| bool | isEnabled () |
| void | setEnabled (bool bEnabled) |
| bool | getAutoUpdate () |
| bool | setAutoUpdate (bool bAuto) |
| KAccelAction * | insert (const QString &sAction, const QString &sLabel, const QString &sWhatsThis, const KShortcut &cutDef, const QObject *pObjSlot, const char *psMethodSlot, bool bConfigurable=true, bool bEnabled=true) |
| KAccelAction * | insert (const QString &sAction, const QString &sLabel, const QString &sWhatsThis, const KShortcut &cutDef3, const KShortcut &cutDef4, const QObject *pObjSlot, const char *psMethodSlot, bool bConfigurable=true, bool bEnabled=true) |
| KAccelAction * | insert (const char *psAction, const KShortcut &cutDef, const QObject *pObjSlot, const char *psMethodSlot, bool bConfigurable=true, bool bEnabled=true) |
| KAccelAction * | insert (KStdAccel::StdAccel id, const QObject *pObjSlot, const char *psMethodSlot, bool bConfigurable=true, bool bEnabled=true) |
| KAccelAction * | insert (const QString &sName, const QString &sLabel) |
| bool | remove (const QString &sAction) |
| bool | updateConnections () |
| const KShortcut & | shortcut (const QString &sAction) const |
| bool | setShortcut (const QString &sAction, const KShortcut &shortcut) |
| bool | setSlot (const QString &sAction, const QObject *pObjSlot, const char *psMethodSlot) |
| bool | setEnabled (const QString &sAction, bool bEnabled) |
| const QString & | configGroup () const |
| void | setConfigGroup (const QString &name) |
| bool | readSettings (KConfigBase *pConfig=0) |
| bool | writeSettings (KConfigBase *pConfig=0) const |
| void | emitKeycodeChanged () |
| bool | insertItem (const QString &sLabel, const QString &sAction, const char *psKey, int nIDMenu=0, QPopupMenu *pMenu=0, bool bConfigurable=true) |
| bool | insertItem (const QString &sLabel, const QString &sAction, int key, int nIDMenu=0, QPopupMenu *pMenu=0, bool bConfigurable=true) |
| bool | insertStdItem (KStdAccel::StdAccel id, const QString &descr=QString::null) |
| bool | connectItem (const QString &sAction, const QObject *pObjSlot, const char *psMethodSlot, bool bActivate=true) |
| bool | connectItem (KStdAccel::StdAccel accel, const QObject *pObjSlot, const char *psMethodSlot) |
| bool | removeItem (const QString &sAction) |
| bool | setItemEnabled (const QString &sAction, bool bEnable) |
| void | changeMenuAccel (QPopupMenu *menu, int id, const QString &action) |
| void | changeMenuAccel (QPopupMenu *menu, int id, KStdAccel::StdAccel accel) |
| int | currentKey (const QString &action) const |
| QString | findKey (int key) const |
Static Public Methods |
| int | stringToKey (const QString &) |
Handle shortcuts.
Allow a user to configure shortcuts through application configuration files or through the KKeyChooser GUI.
A KAccel contains a list of accelerator actions.
For example, CTRL+Key_P could be a shortcut for printing a document. The key codes are listed in qnamespace.h. "Print" could be the action name for printing. The action name identifies the shortcut in configuration files and the KKeyChooser GUI.
A KAccel object handles key events sent to its parent widget and to all children of this parent widget. The most recently created KAccel object has precedence over any KAccel objects created before it. When a shortcut pressed, KAccel calls the slot to which it has been connected. If you want to set global accelerators, independent of the window which has the focus, use KGlobalAccel.
Reconfiguration of a given shortcut can be prevented by specifying that an accelerator item is not configurable when it is inserted. A special group of non-configurable key bindings are known as the standard accelerators.
The standard accelerators appear repeatedly in applications for standard document actions such as printing and saving. A convenience method is available to insert and connect these accelerators which are configurable on a desktop-wide basis.
It is possible for a user to choose to have no key associated with an action.