mirror of
https://github.com/Skycoder42/QHotkey.git
synced 2026-11-19 12:49:58 +03:00
doc ready and add QPrivateSignal to activated
This commit is contained in:
+7
-10
@@ -34,11 +34,6 @@ QHotkey::~QHotkey()
|
||||
QHotkeyPrivate::instance()->removeShortcut(this);
|
||||
}
|
||||
|
||||
bool QHotkey::isKeyCaptured(Qt::Key key, Qt::KeyboardModifiers modifiers)
|
||||
{
|
||||
return QHotkeyPrivate::instance()->hasShortcut(key, modifiers);
|
||||
}
|
||||
|
||||
QKeySequence QHotkey::shortcut() const
|
||||
{
|
||||
if(this->key == Qt::Key_unknown)
|
||||
@@ -86,6 +81,13 @@ bool QHotkey::setShortcut(Qt::Key key, Qt::KeyboardModifiers modifiers, bool aut
|
||||
return false;
|
||||
}
|
||||
|
||||
if(key == Qt::Key_unknown) {
|
||||
this->key = Qt::Key_unknown;
|
||||
this->mods = Qt::NoModifier;
|
||||
this->nativeShortcut = NativeShortcut();
|
||||
return true;
|
||||
}
|
||||
|
||||
this->key = key;
|
||||
this->mods = modifiers;
|
||||
this->nativeShortcut = QHotkeyPrivate::instance()->nativeShortcut(key, modifiers);
|
||||
@@ -163,11 +165,6 @@ QHotkey::NativeShortcut QHotkeyPrivate::nativeShortcut(Qt::Key keycode, Qt::Keyb
|
||||
return res;
|
||||
}
|
||||
|
||||
bool QHotkeyPrivate::hasShortcut(Qt::Key keycode, Qt::KeyboardModifiers modifiers)
|
||||
{
|
||||
return this->shortcuts.contains(this->nativeShortcut(keycode, modifiers));
|
||||
}
|
||||
|
||||
bool QHotkeyPrivate::addShortcut(QHotkey *hotkey)
|
||||
{
|
||||
if(hotkey->registered)
|
||||
|
||||
Reference in New Issue
Block a user