The QxtGlobalShortcut class provides a global shortcut aka "hotkey".
More...
|
|
class | QxtGlobalShortcutPrivate |
| |
The QxtGlobalShortcut class provides a global shortcut aka "hotkey".
A global shortcut triggers even if the application is not active. This makes it easy to implement applications that react to certain shortcuts still if some other application is active or if the application is for example minimized to the system tray.
Example usage:
connect(shortcut, SIGNAL(
activated()), window, SLOT(toggleVisibility()));
shortcut->setShortcut(QKeySequence("Ctrl+Shift+F12"));
§ QxtGlobalShortcut() [1/2]
| QxtGlobalShortcut::QxtGlobalShortcut |
( |
QObject * |
parent = nullptr | ) |
|
|
explicit |
§ QxtGlobalShortcut() [2/2]
| QxtGlobalShortcut::QxtGlobalShortcut |
( |
const QKeySequence & |
shortcut, |
|
|
QObject * |
parent = nullptr |
|
) |
| |
|
explicit |
§ ~QxtGlobalShortcut()
| QxtGlobalShortcut::~QxtGlobalShortcut |
( |
| ) |
|
§ activated
This signal is emitted when the user types the shortcut's key sequence.
- See also
- shortcut
§ setDisabled
| void QxtGlobalShortcut::setDisabled |
( |
bool |
disabled = true | ) |
|
|
slot |
Sets the shortcut disabled.
- See also
- enabled
§ setEnabled
| void QxtGlobalShortcut::setEnabled |
( |
bool |
enabled = true | ) |
|
|
slot |
Sets the shortcut enabled.
- See also
- enabled
§ enabled
| QxtGlobalShortcut::enabled |
|
readwrite |
whether the shortcut is enabled
A disabled shortcut does not get activated.
The default value is true.
- See also
- setEnabled(), setDisabled()
§ shortcut
| QxtGlobalShortcut::shortcut |
|
readwrite |
the shortcut key sequence
sets the shortcut key sequence
Notice that corresponding key press and release events are not delivered for registered global shortcuts even if they are disabled. Also, comma separated key sequences are not supported. Only the first part is used:
qxtShortcut->setShortcut(QKeySequence("Ctrl+Alt+A,Ctrl+Alt+B"));
Q_ASSERT(qxtShortcut->shortcut() == QKeySequence("Ctrl+Alt+A"));
- See also
- setShortcut()
-
shortcut()
The documentation for this class was generated from the following files: