doc ready and add QPrivateSignal to activated

This commit is contained in:
Skycoder42
2016-02-08 15:33:52 +01:00
parent c6da3ca9c0
commit 3c40d30190
6 changed files with 177 additions and 27 deletions
+7 -10
View File
@@ -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)