17 #include "globalshortcut.h"
18 #include "globalshortcutregistry.h"
35 void GlobalShortcut::setShortcut(
const QVariant &shortcut)
37 if (m_shortcut == shortcut)
40 m_shortcut = shortcut;
41 registry->addShortcut(shortcut,
this);
42 Q_EMIT shortcutChanged(shortcut);
45 bool GlobalShortcut::isActive()
const
50 void GlobalShortcut::setActive(
bool active)
52 if (m_active == active)
56 Q_EMIT activeChanged(active);
59 void GlobalShortcut::componentComplete()
61 connect(
this, &QQuickItem::windowChanged,
this, &GlobalShortcut::setupFilterOnWindow);
64 void GlobalShortcut::keyPressEvent(QKeyEvent * event)
72 void GlobalShortcut::setupFilterOnWindow(QQuickWindow *window)
79 registry->setupFilterOnWindow((qulonglong) window->winId());
The GlobalShortcutRegistry class.
void triggered(const QString &shortcut)
The GlobalShortcut class.