edbee - Qt Editor Library
|
This emthod method can be used to load text-editor keymaps. More...
#include <keymapparser.h>
Public Member Functions | |
KeyMapParser () | |
constructs the keymapparser More... | |
virtual | ~KeyMapParser () |
destructs the keymapparser More... | |
bool | parse (const QString &filename, TextEditorKeyMap *keyMap) |
loads the given keymap file returns true on success More... | |
bool | parse (QIODevice *device, TextEditorKeyMap *keyMap) |
bool | parse (const QByteArray &bytes, TextEditorKeyMap *keyMap) |
bool | parse (const QVariant &variant, TextEditorKeyMap *keyMap) |
Parsers the variant map so the keymapManager is filled. More... | |
QString | errorMessage () const |
Returns the error message. More... | |
This emthod method can be used to load text-editor keymaps.
The json file has got the following format
[ { "context": { "name": "texteditor", // the part of the appliction these bindigns used for. ... }, "defaults": { "context": [ { // the context defined here is coppied to alle keybindings {"key": "scope", "value": "source.php"}, ... }] }, "bindings": [ { "keys": "Ctrl+M,U", "command": "display_undo_stack" }, // todo, add scopes to keybindings .... ] }, ... ]
Context is still not completely thought over but it is used to make certain keybindings context specific. Think for example of keybindings only used for given language
edbee::KeyMapParser::KeyMapParser | ( | ) |
constructs the keymapparser
|
virtual |
destructs the keymapparser
QString edbee::KeyMapParser::errorMessage | ( | ) | const |
Returns the error message.
bool edbee::KeyMapParser::parse | ( | const QString & | filename, |
TextEditorKeyMap * | keyMap | ||
) |
loads the given keymap file returns true on success
filename | the file to parse |
keyMap | the keymapfile to put the results in |
bool edbee::KeyMapParser::parse | ( | QIODevice * | device, |
TextEditorKeyMap * | keyMap | ||
) |
bool edbee::KeyMapParser::parse | ( | const QByteArray & | bytes, |
TextEditorKeyMap * | keyMap | ||
) |
bool edbee::KeyMapParser::parse | ( | const QVariant & | variant, |
TextEditorKeyMap * | keyMap | ||
) |
Parsers the variant map so the keymapManager is filled.
variant | the variant to parse |
manager | the manager to parse |
manager | the keymap manager |