![]() |
Sayonara Player
|
#include <Shortcut.h>
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.
Public Member Functions | |
| Shortcut (ShortcutWidget *parent, const QString &identifier, const QString &name, const QString &default_shortcut) | |
| Shortcut. More... | |
| Shortcut (ShortcutWidget *parent, const QString &identifier, const QString &name, const QStringList &default_shortcuts) | |
| Shortcut. More... | |
| Shortcut (const Shortcut &other) | |
| Copy constructor. More... | |
| Shortcut & | operator= (const Shortcut &other) |
| void | change_shortcut (const QStringList &shortcuts) |
| QString | get_name () const |
| get the human-readable name of the shortcut More... | |
| QStringList | get_default () const |
| get a human-readable list of mapped default shortcuts More... | |
| QList< QKeySequence > | get_sequences () const |
| get a list key squences mapped to this shortcut More... | |
| QStringList | get_shortcuts () const |
| get a human-readable list of mapped shortcuts More... | |
| QString | get_identifier () const |
| get the unique identifier More... | |
| bool | is_valid () const |
| Check if the shortcut is valid or if it was retrieved via getInvalid() More... | |
| template<typename T > | |
| void | create_qt_shortcut (QWidget *parent, T func) |
| create a qt shortcut for a widget More... | |
| void | create_qt_shortcut (QWidget *parent, QObject *receiver, const char *slot) |
| create a qt shortcut for a widget More... | |
Static Public Member Functions | |
| static Shortcut | getInvalid () |
| get a raw and invalid shortcut. This function is used instead of the default constructor More... | |
Private Attributes | |
| Settings * | _settings =nullptr |
| Shortcut::Shortcut | ( | ShortcutWidget * | parent, |
| const QString & | identifier, | ||
| const QString & | name, | ||
| const QString & | default_shortcut | ||
| ) |
| Shortcut::Shortcut | ( | ShortcutWidget * | parent, |
| const QString & | identifier, | ||
| const QString & | name, | ||
| const QStringList & | default_shortcuts | ||
| ) |
| Shortcut::Shortcut | ( | const Shortcut & | other | ) |
Copy constructor.
| other |
| void Shortcut::change_shortcut | ( | const QStringList & | shortcuts | ) |
| shortcuts | map new user-readable key sequences to this shortcut |
|
inline |
create a qt shortcut for a widget
| parent | the widget the shortcut is attached to |
| func | a lambda function which will be triggered when shortcut is pressed |
| void Shortcut::create_qt_shortcut | ( | QWidget * | parent, |
| QObject * | receiver, | ||
| const char * | slot | ||
| ) |
create a qt shortcut for a widget
| parent | the widget the shortcut is attached to |
| the | receiver object of the shortcut |
| the | slot which is triggered when pressing that shortcut |
| QStringList Shortcut::get_default | ( | ) | const |
get a human-readable list of mapped default shortcuts
| QString Shortcut::get_identifier | ( | ) | const |
get the unique identifier
| QString Shortcut::get_name | ( | ) | const |
get the human-readable name of the shortcut
| QList<QKeySequence> Shortcut::get_sequences | ( | ) | const |
get a list key squences mapped to this shortcut
| QStringList Shortcut::get_shortcuts | ( | ) | const |
get a human-readable list of mapped shortcuts
|
static |
get a raw and invalid shortcut. This function is used instead of the default constructor
| bool Shortcut::is_valid | ( | ) | const |
Check if the shortcut is valid or if it was retrieved via getInvalid()
1.8.13