class KShortcut


Table of contents
Modules
kdeui Classes
All Classes
Module kdeui
Namespace global
Class KShortcut
Inherits

kshortcut.h Defines platform-independent classes for keyboard shortcut handling. Represents a keyboard shortcut

The KShortcut class is used to represent a keyboard shortcut to an action. A shortcut is normally a single key with modifiers, such as Ctrl+V. A KShortcut object may also contain an alternate key sequence which will also activate the action it's associated to, as long as no other actions have defined that key as their primary key. Ex: Ctrl+V;Shift+Insert.

This can be used to add additional accelerators to a KAction. For example, the below code binds the escape key to the close action.

KAction *closeAction = KStdAction.close(this, SLOT( close() ), actionCollection());
KShortcut closeShortcut = closeAction->shortcut();
closeShortcut.setAlternate(Qt.Key_Escape);
closeAction->setShortcut(closeShortcut);



enums

enum details

methods