17 connect(shortcut, SIGNAL(activated()),
object, slot);
25 connect(shortcut, SIGNAL(activated()),
object, slot);
35 m_hotkeys[index]->setShortcut(QKeySequence(key));
53 key->setEnabled(
false);
61 key->setEnabled(enabled);
87 const QString strModList[] = {
"Ctrl",
"Shift",
"Alt"};
88 const quint32 modList[] = {Qt::ControlModifier, Qt::ShiftModifier, Qt::AltModifier};
91 for(
int i = 0; i < 3; ++i)
93 if(modifiers & modList[i])
95 keyStr.append(strModList[i] +
"+");
99 if(key == Qt::Key_Shift || key == Qt::Key_Control || key == Qt::Key_Alt)
105 return keyStr + QKeySequence(key).toString();
116 keys <<
"Ctrl+B" <<
"Ctrl+Left" <<
"Ctrl+Right" <<
"Ctrl+Up"
117 <<
"Ctrl+Down" <<
"Ctrl+S" <<
"Ctrl+I" <<
"Ctrl+M";
126 keys <<
key->shortcut().toString();
static constexpr wchar_t key[]
void addHotKey(QObject *object)
QStringList defaultKeys() const
QList< QGlobalShortcut * > m_hotkeys
void setEnabled(bool enabled)
bool isEnabled(int index)
QObject * hotKey(int index)
The class of the qglobal shortcut.
void setHotKey(int index, const QString &key)
QString toString(int key, int modifiers)