A single shortcut managed by ShortcutHandler. This class holds information about the default shortcuts, the user defined shortcuts, a name attached to each shortcut an identifier which is written into the database and a list of the corresponding shortcuts in the Qt format.
More...
#include <Shortcut.h>
|
| | Shortcut (ShortcutIdentifier identifier, const QString &defaultShortcut) |
| | Shortcut.
|
| | Shortcut (ShortcutIdentifier identifier, const QStringList &defaultShortcuts) |
| | Shortcut.
|
| | Shortcut (const Shortcut &other) |
| | Copy constructor.
|
|
Shortcut & | operator= (const Shortcut &other) |
| void | changeShortcut (const QStringList &shortcuts) |
| QString | name () const |
| | get the human-readable name of the shortcut
|
| QStringList | defaultShortcut () const |
| | get a human-readable list of mapped default shortcuts
|
| QList< QKeySequence > | sequences () const |
| | get a list key squences mapped to this shortcut
|
|
QKeySequence | sequence () const |
| const QStringList & | shortcuts () const |
| | get a human-readable list of mapped shortcuts
|
| ShortcutIdentifier | identifier () const |
| | get the unique identifier
|
|
QString | databaseKey () const |
| bool | isValid () const |
| | Check if the shortcut is valid or if it was retrieved via getInvalid().
|
| template<typename T> |
| void | connect (QWidget *parent, T func, Qt::ShortcutContext context=Qt::WindowShortcut) |
| | create a qt shortcut for a widget
|
| void | connect (QWidget *parent, QObject *receiver, const char *slot, Qt::ShortcutContext context=Qt::WindowShortcut) |
| | create a qt shortcut for a widget
|
|
| static Shortcut | getInvalid () |
| | get a raw and invalid shortcut. This function is used instead of the default constructor
|
A single shortcut managed by ShortcutHandler. This class holds information about the default shortcuts, the user defined shortcuts, a name attached to each shortcut an identifier which is written into the database and a list of the corresponding shortcuts in the Qt format.
◆ Shortcut() [1/3]
| Shortcut::Shortcut |
( |
ShortcutIdentifier | identifier, |
|
|
const QString & | defaultShortcut ) |
Shortcut.
- Parameters
-
| identifier | an unique identifier used to write the shortcut into the database |
| name | the name displayed in the Shortcut configuration dialog |
| defaultShortcut | one default shortcut |
◆ Shortcut() [2/3]
| Shortcut::Shortcut |
( |
ShortcutIdentifier | identifier, |
|
|
const QStringList & | defaultShortcuts ) |
Shortcut.
- Parameters
-
| identifier | an unique identifier used to write the shortcut into the database |
| name | the name displayed in the Shortcut configuration dialog |
| defaultShortcuts | a list of default shortcuts |
◆ Shortcut() [3/3]
| Shortcut::Shortcut |
( |
const Shortcut & | other | ) |
|
Copy constructor.
- Parameters
-
◆ changeShortcut()
| void Shortcut::changeShortcut |
( |
const QStringList & | shortcuts | ) |
|
- Parameters
-
| shortcuts | map new user-readable key sequences to this shortcut |
◆ connect() [1/2]
| void Shortcut::connect |
( |
QWidget * | parent, |
|
|
QObject * | receiver, |
|
|
const char * | slot, |
|
|
Qt::ShortcutContext | context = Qt::WindowShortcut ) |
create a qt shortcut for a widget
- Parameters
-
| parent | the widget the shortcut is attached to |
| the | receiver object of the shortcut |
| the | slot which is triggered when pressing that shortcut |
◆ connect() [2/2]
template<typename T>
| void Shortcut::connect |
( |
QWidget * | parent, |
|
|
T | func, |
|
|
Qt::ShortcutContext | context = Qt::WindowShortcut ) |
|
inline |
create a qt shortcut for a widget
- Parameters
-
| parent | the widget the shortcut is attached to |
| func | a lambda function which will be triggered when shortcut is pressed |
◆ defaultShortcut()
| QStringList Shortcut::defaultShortcut |
( |
| ) |
const |
get a human-readable list of mapped default shortcuts
- Returns
◆ getInvalid()
get a raw and invalid shortcut. This function is used instead of the default constructor
- Returns
- an uninitialized shortcut
◆ identifier()
| ShortcutIdentifier Shortcut::identifier |
( |
| ) |
const |
get the unique identifier
- Returns
◆ isValid()
| bool Shortcut::isValid |
( |
| ) |
const |
Check if the shortcut is valid or if it was retrieved via getInvalid().
- Returns
◆ name()
| QString Shortcut::name |
( |
| ) |
const |
get the human-readable name of the shortcut
- Returns
◆ sequences()
| QList< QKeySequence > Shortcut::sequences |
( |
| ) |
const |
get a list key squences mapped to this shortcut
- Returns
◆ shortcuts()
| const QStringList & Shortcut::shortcuts |
( |
| ) |
const |
get a human-readable list of mapped shortcuts
- Returns