A text editor key map This key map, maps key-sequences to action-names.
More...
#include <texteditorkeymap.h>
|
| TextEditorKeyMap (TextEditorKeyMap *parentKeyMap=0) |
|
virtual | ~TextEditorKeyMap () |
| the copy constructor More...
|
|
void | copyKeysTo (TextEditorKeyMap *keyMap) |
| copies the given keys to the other keymap More...
|
|
TextEditorKey * | get (const QString &name) const |
| Returns the last inserted keysequence for the given command It also tries to search the parent keymap if it's available. More...
|
|
QKeySequence | getSequence (const QString &name) const |
| Returns the key sequence for the given name. More...
|
|
QList< TextEditorKey * > | getAll (const QString &name) const |
| Returns al list of all keysequences for the given command This method will also search the parents for the given keysequences. More...
|
|
bool | has (const QString &name) const |
| Tests if the keymap has the given action It will also search the parent key map. More...
|
|
void | add (const QString &command, TextEditorKey *sequence) |
| Adds the given key sequence to the keymap. More...
|
|
void | add (const QString &command, const QKeySequence &seq) |
| Adds the given key sequence to the keymap. More...
|
|
bool | add (const QString &command, const QString &seq) |
| Adds a command - key sequence with a string If first tries to match the string with the standardkey-texts If this doesn't result in a sequence it assumes it's a keydefinition used by QKeySequence. More...
|
|
void | replace (const QString &name, TextEditorKey *sequence) |
| replace the given command with the given key sequence all other keysequences (on this level) are ignored More...
|
|
QString | findBySequence (QKeySequence sequence, QKeySequence::SequenceMatch &match) |
| Searches for the given command with a keysequence Warning when one keysequence is the prefix of the other keysequence it is possible only the partial or full match is return (depending on the order) More...
|
|
QString | toString () const |
| returns all added actions More...
|
|
TextEditorKeyMap * | parentMap () |
|
|
static QKeySequence | joinKeySequences (const QKeySequence seq1, const QKeySequence seq2) |
| This method joins 2 key-sequences to 1 sequence (if possible) if seq1 + se2 length > 4 seq2 is returned. More...
|
|
static QKeySequence::StandardKey | standardKeyFromString (const QString &str) |
| converts a string to a standard key if the standard key isn't found it returns 'QKeySequence::UnknownKey ' More...
|
|
A text editor key map This key map, maps key-sequences to action-names.
◆ TextEditorKeyMap()
edbee::TextEditorKeyMap::TextEditorKeyMap |
( |
TextEditorKeyMap * |
parentKeyMap = 0 | ) |
|
◆ ~TextEditorKeyMap()
edbee::TextEditorKeyMap::~TextEditorKeyMap |
( |
| ) |
|
|
virtual |
the copy constructor
empty the keymap
◆ add() [1/3]
void edbee::TextEditorKeyMap::add |
( |
const QString & |
command, |
|
|
TextEditorKey * |
sequence |
|
) |
| |
Adds the given key sequence to the keymap.
- Parameters
-
command | the name of the editor command |
sequence | the keysequence |
◆ add() [2/3]
void edbee::TextEditorKeyMap::add |
( |
const QString & |
command, |
|
|
const QKeySequence & |
seq |
|
) |
| |
Adds the given key sequence to the keymap.
- Parameters
-
name | the name of the editor command |
sequence | the keysequence |
◆ add() [3/3]
bool edbee::TextEditorKeyMap::add |
( |
const QString & |
command, |
|
|
const QString & |
seq |
|
) |
| |
Adds a command - key sequence with a string If first tries to match the string with the standardkey-texts If this doesn't result in a sequence it assumes it's a keydefinition used by QKeySequence.
- Parameters
-
command | the command name |
seq | the key sequence definition |
◆ copyKeysTo()
copies the given keys to the other keymap
- Parameters
-
keyMap | the keymap to copy the keys from |
◆ findBySequence()
QString edbee::TextEditorKeyMap::findBySequence |
( |
QKeySequence |
sequence, |
|
|
QKeySequence::SequenceMatch & |
match |
|
) |
| |
Searches for the given command with a keysequence Warning when one keysequence is the prefix of the other keysequence it is possible only the partial or full match is return (depending on the order)
- Parameters
-
sequence | the pressed key-sequence |
match | the sequence match: (NoMatch, PartialMatch, ExactMatch) |
- Returns
- the (partial) matched command or a empty string if not found
◆ get()
TextEditorKey * edbee::TextEditorKeyMap::get |
( |
const QString & |
name | ) |
const |
Returns the last inserted keysequence for the given command It also tries to search the parent keymap if it's available.
- Parameters
-
name | the name of the given command |
- Returns
- the keysequence or 0 if not found
◆ getAll()
QList< TextEditorKey * > edbee::TextEditorKeyMap::getAll |
( |
const QString & |
name | ) |
const |
Returns al list of all keysequences for the given command This method will also search the parents for the given keysequences.
◆ getSequence()
QKeySequence edbee::TextEditorKeyMap::getSequence |
( |
const QString & |
name | ) |
const |
Returns the key sequence for the given name.
- Parameters
-
name | the name of the key sequence |
- Returns
- a QKeySequence
◆ has()
bool edbee::TextEditorKeyMap::has |
( |
const QString & |
name | ) |
const |
Tests if the keymap has the given action It will also search the parent key map.
◆ joinKeySequences()
QKeySequence edbee::TextEditorKeyMap::joinKeySequences |
( |
const QKeySequence |
seq1, |
|
|
const QKeySequence |
seq2 |
|
) |
| |
|
static |
This method joins 2 key-sequences to 1 sequence (if possible) if seq1 + se2 length > 4 seq2 is returned.
◆ parentMap()
◆ replace()
void edbee::TextEditorKeyMap::replace |
( |
const QString & |
name, |
|
|
TextEditorKey * |
sequence |
|
) |
| |
replace the given command with the given key sequence all other keysequences (on this level) are ignored
◆ standardKeyFromString()
QKeySequence::StandardKey edbee::TextEditorKeyMap::standardKeyFromString |
( |
const QString & |
str | ) |
|
|
static |
converts a string to a standard key if the standard key isn't found it returns 'QKeySequence::UnknownKey '
◆ toString()
QString edbee::TextEditorKeyMap::toString |
( |
| ) |
const |
returns all added actions
The documentation for this class was generated from the following files: