UI: Use QKeyCombination's methods

This commit is contained in:
Nodir Temirkhodjaev 2024-05-29 15:39:17 +03:00
parent 1b0ed39a08
commit 71c2ad9094
2 changed files with 2 additions and 4 deletions

View File

@ -711,8 +711,7 @@ void TrayIcon::updateActionHotKeys()
if (!shortcut.isEmpty() && iniKey == HotKey::appGroupModifier) {
const QKeyCombination key = shortcut[0];
shortcut = Qt::KeyboardModifiers(key & Qt::KeyboardModifierMask)
| (Qt::Key_F1 + groupIndex);
shortcut = key.keyboardModifiers() | (Qt::Key_F1 + groupIndex);
++groupIndex;
}

View File

@ -128,8 +128,7 @@ bool NativeEventFilter::registerHotKey(
bool NativeEventFilter::registerHotKey(int hotKeyId, QKeyCombination key)
{
return registerHotKey(hotKeyId, Qt::Key(key & ~Qt::KeyboardModifierMask),
Qt::KeyboardModifiers(key & Qt::KeyboardModifierMask));
return registerHotKey(hotKeyId, key.key(), key.keyboardModifiers());
}
void NativeEventFilter::unregisterHotKeys()