13 #ifndef __SHORTCUT_H__ 14 #define __SHORTCUT_H__ 84 return static_cast<ShortcutFlags>(
static_cast<int>(t1) | static_cast<int>(t2));
88 return static_cast<int>(t1) & static_cast<int>(t2);
91 static const int KEYSEQ_SIZE = 4;
108 Qt::ShortcutContext _context { Qt::WindowShortcut };
113 QKeySequence::StandardKey _standardKey { QKeySequence::UnknownKey };
114 mutable QAction* _action { 0 };
120 void translateAction(QAction* action)
const;
124 static constexpr
const char* defaultFileName =
":/data/shortcuts.xml";
135 Qt::ShortcutContext cont = Qt::WindowShortcut,
139 QAction* action()
const;
140 const QByteArray&
key()
const {
return _key; }
141 void setKey(
const QByteArray& key) { _key = key; }
142 QString descr()
const;
143 QString text()
const;
144 QString help()
const;
148 void addShortcut(
const QKeySequence&);
149 int state()
const {
return _state; }
156 const QList<QKeySequence>&
keys()
const {
return _keys; }
157 QKeySequence::StandardKey
standardKey()
const {
return _standardKey; }
158 void setStandardKey(QKeySequence::StandardKey k);
159 void setKeys(
const QList<QKeySequence>& ks);
162 bool compareKeys(
const Shortcut&)
const;
163 QString keysToString()
const;
164 static QString getMenuShortcutString(
const QMenu* menu);
170 static void retranslate();
171 static void refreshIcons();
173 static void loadFromNewFile(QString fileLocation);
175 static void saveToNewFile(QString fileLocation);
176 static void resetToDefault();
179 static Shortcut* getShortcutByKeySequence(
const QKeySequence &keySequence,
const ScoreState state);
180 static Shortcut* getShortcut(
const char* key);
181 static const QHash<QByteArray, Shortcut*>&
shortcuts() {
return _shortcuts; }
182 static QActionGroup* getActionGroupForWidget(
MsWidget w);
183 static QActionGroup* getActionGroupForWidget(
MsWidget w, Qt::ShortcutContext newShortcutContext);
185 static QString keySeqToString(
const QKeySequence& keySeq, QKeySequence::SequenceFormat fmt,
bool escapeKeyStr =
false);
186 static QKeySequence keySeqFromString(
const QString& str, QKeySequence::SequenceFormat fmt);
static bool dirty
Definition: shortcut.h:177
static const QHash< QByteArray, Shortcut * > & shortcuts()
Definition: shortcut.h:181
MsWidget
Definition: globals.h:43
QList< QKeySequence > _keys
Definition: shortcut.h:111
constexpr ArticulationShowIn operator|(ArticulationShowIn a1, ArticulationShowIn a2)
Definition: articulation.h:45
const QList< QKeySequence > & keys() const
Definition: shortcut.h:156
ScoreState
Definition: globals.h:53
constexpr bool operator &(ArticulationShowIn a1, ArticulationShowIn a2)
Definition: articulation.h:48
bool needsScore() const
Definition: shortcut.h:151
MsWidget _assignedWidget
Definition: shortcut.h:99
bool isCmd() const
Definition: shortcut.h:152
QByteArray _descr
xml tag name for configuration file
Definition: shortcut.h:102
bool isCheckable() const
Definition: shortcut.h:153
Shortcut()
Definition: shortcut.h:126
MsWidget assignedWidget() const
Definition: shortcut.h:145
void setState(int v)
Definition: shortcut.h:150
const QByteArray & key() const
Definition: shortcut.h:140
QByteArray _help
text as shown on buttons or menus
Definition: shortcut.h:104
Definition: aeolus.cpp:26
void setKey(const QByteArray &key)
Definition: shortcut.h:141
Icons
Definition: icons.h:27
QByteArray _key
shortcut is valid in this Mscore state
Definition: shortcut.h:101
Definition: xmlwriter.h:26
QKeySequence::StandardKey standardKey() const
Definition: shortcut.h:157
ShortcutFlags
Definition: shortcut.h:75
bool isChecked() const
Definition: shortcut.h:154
QByteArray _text
descriptor, shown in editor
Definition: shortcut.h:103
Icons icon() const
Definition: shortcut.h:155
Definition: xmlreader.h:28
static QHash< QByteArray, Shortcut * > _shortcuts
Definition: shortcut.h:119
static bool customSource()
Definition: shortcut.h:178
static QString source
cached action
Definition: shortcut.h:116
int state() const
Definition: shortcut.h:149
Definition: shortcut.h:98