KShortcut Class Reference
The KShortcut class is used to represent a keyboard shortcut to an action. More...
#include <kshortcut.h>
Public Types | |
enum | { MAX_SEQUENCES = 2 } |
Public Member Functions | |
KShortcut () | |
KShortcut (int keyQt) | |
KShortcut (const QKeySequence &keySeq) | |
KShortcut (const KKey &key) | |
KShortcut (const KKeySequence &keySeq) | |
KShortcut (const KShortcut &shortcut) | |
KShortcut (const char *shortcut) | |
KShortcut (const QString &shortcut) | |
void | clear () |
bool | init (int keyQt) |
bool | init (const QKeySequence &keySeq) |
bool | init (const KKey &key) |
bool | init (const KKeySequence &keySeq) |
bool | init (const KShortcut &shortcut) |
bool | init (const QString &shortcut) |
KShortcut & | operator= (const KShortcut &cut) |
uint | count () const |
const KKeySequence & | seq (uint i) const |
int | keyCodeQt () const |
bool | isNull () const |
int | compare (const KShortcut &shortcut) const |
bool | operator== (const KShortcut &cut) const |
bool | operator!= (const KShortcut &cut) const |
bool | operator< (const KShortcut &cut) const |
bool | contains (const KKey &key) const |
bool | contains (const KKeyNative &key) const |
bool | contains (const KKeySequence &keySeq) const |
bool | setSeq (uint i, const KKeySequence &keySeq) |
bool | append (const KKeySequence &keySeq) |
void | remove (const KKeySequence &keySeq) |
bool | append (const KKey &spec) |
bool | append (const KShortcut &cut) |
operator QKeySequence () const | |
QString | toString () const |
QString | toStringInternal (const KShortcut *pcutDefault=0) const |
operator int () const | |
Static Public Member Functions | |
KShortcut & | null () |
Protected Attributes | |
uint | m_nSeqs |
KKeySequence | m_rgseq [MAX_SEQUENCES] |
Detailed Description
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 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.
Definition at line 527 of file kshortcut.h.
Member Enumeration Documentation
|
The maximum number of key sequences that can be contained in a KShortcut. Definition at line 534 of file kshortcut.h. |
Constructor & Destructor Documentation
|
Creates a new null shortcut. Definition at line 416 of file kshortcut.cpp. References clear(). |
|
Creates a new shortcut with the given Qt key code as the only key sequence.
References init(). |
|
Creates a new shortcut that contains only the given qt key sequence.
References init(). |
|
Creates a new shortcut that contains only the given key in its only sequence.
References init(). |
|
Creates a new shortcut that contains only the given key sequence.
References init(). |
|
Copies the given shortcut.
References init(). |
|
Creates a new key sequence that contains the given key sequence. The description consists of semicolon-separated keys as used in KKeySequence::KKeySequence(const QString&).
References init(). |
|
Creates a new key sequence that contains the given key sequence. The description consists of semicolon-separated keys as used in KKeySequence::KKeySequence(const QString&).
References init(). |
Member Function Documentation
|
Clears the shortcut. The shortcut is null after calling this function.
Referenced by init(), KShortcut(), and null(). |
|
Initializes the shortcut with the given Qt key code as the only key sequence.
References clear(), and KKeySequence::init(). Referenced by KShortcut(). |
|
Initializes the shortcut with the given qt key sequence.
References KKeySequence::init(). |
|
Initializes the shortcut with the given key as its only sequence.
References KKeySequence::init(). |
|
Initializes the shortcut with the given qt key sequence.
|
|
Copies the given shortcut.
|
|
Initializes the key sequence with the given key sequence. The description consists of semicolon-separated keys as used in KKeySequence::KKeySequence(const QString&).
References clear(), KKeyServer::Variations::count(), endl(), KKeyServer::Variations::init(), KKeySequence::init(), and KKeyServer::Variations::m_rgkey. |
|
Copies the given shortcut over this shortcut. Definition at line 649 of file kshortcut.h. References KKey::init(). |
|
Returns the number of sequences that are in this shortcut.
Referenced by contains(), operator QKeySequence(), and toString(). |
|
Returns the
References KKeySequence::null(). Referenced by append(). |
|
Returns the key code of the first key sequence, or null if there is no first key sequence.
References KKeySequence::keyCodeQt(). Referenced by KStdAccel::defaultKey(), and KStdAccel::key(). |
|
Returns true if the shortcut is null (after clear() or empty constructor).
Referenced by KCompletion::makeCompletion(), and null(). |
|
Compares this object with the given shortcut. Returns a negative number if the given shortcut is larger, 0 if they are equal and a positive number this shortcut is larger. Shortcuts are compared by comparing the individual key sequences, starting from the beginning until an unequal key sequences has been found. If a shortcut contains more key sequences, it is considered larger.
References KKeySequence::compare(). |
|
Compares the sequences of both shortcuts.
References KKey::compare(). |
|
Compares the sequences of both shortcuts.
References KKey::compare(). |
|
Compares the sequences of both shortcuts.
References KKey::compare(). |
|
Checks whether this shortcut contains a sequence that starts with the given key.
Referenced by append(), and KShortcutList::index(). |
|
Checks whether this shortcut contains a sequence that starts with the given key.
References KKeySequence::count(), count(), KKeySequence::isNull(), KKeySequence::key(), and KKeyNative::key(). |
|
Checks whether this shortcut contains the given sequence.
References count(), and KKeySequence::isNull(). |
|
Sets the
You can not introduce gaps in the list of sequences, so you must use an
|
|
Appends the given key sequence.
References KKeySequence::isNull(). |
|
Removes the given key sequence from this shortcut.
References KKeySequence::isNull(). |
|
Appends the given key.
References KKeySequence::init(). |
|
Appends the sequences from the given shortcut.
References contains(), and seq(). |
|
Converts this shortcut to a key sequence. The first key sequence will be taken.Definition at line 638 of file kshortcut.cpp. References count(), and KKeySequence::qt(). |
|
Returns a description of the shortcut as semicolon-separated ket sequences, as returned by KKeySequence::toString().
References count(), and KKeySequence::toString(). |
|
Returns a null shortcut.
References clear(), and isNull(). Referenced by KStdAccel::shortcut(), KGlobalAccel::shortcut(), and KAccel::shortcut(). |
The documentation for this class was generated from the following files: