Hotkey release signal

This commit is contained in:
Alexandre Vicente
2020-04-21 12:45:10 -03:00
parent 9583eafe76
commit 5b507a84df
6 changed files with 90 additions and 11 deletions
+7
View File
@@ -262,6 +262,13 @@ void QHotkeyPrivate::activateShortcut(QHotkey::NativeShortcut shortcut)
signal.invoke(hkey, Qt::QueuedConnection);
}
void QHotkeyPrivate::releaseShortcut(QHotkey::NativeShortcut shortcut)
{
QMetaMethod signal = QMetaMethod::fromSignal(&QHotkey::released);
for(QHotkey *hkey : shortcuts.values(shortcut))
signal.invoke(hkey, Qt::QueuedConnection);
}
void QHotkeyPrivate::addMappingInvoked(Qt::Key keycode, Qt::KeyboardModifiers modifiers, const QHotkey::NativeShortcut &nativeShortcut)
{
mapping.insert({keycode, modifiers}, nativeShortcut);