![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qshortcutmap_p.h>
Public Types | |
| typedef bool(* | ContextMatcher) (QObject *object, Qt::ShortcutContext context) |
Public Member Functions | |
| QShortcutMap () | |
| ~QShortcutMap () | |
| int | addShortcut (QObject *owner, const QKeySequence &key, Qt::ShortcutContext context, ContextMatcher matcher) |
| int | removeShortcut (int id, QObject *owner, const QKeySequence &key=QKeySequence()) |
| int | setShortcutEnabled (bool enable, int id, QObject *owner, const QKeySequence &key=QKeySequence()) |
| int | setShortcutAutoRepeat (bool on, int id, QObject *owner, const QKeySequence &key=QKeySequence()) |
| QKeySequence::SequenceMatch | state () |
| bool | tryShortcut (QKeyEvent *e) |
| bool | hasShortcutForKeySequence (const QKeySequence &seq) const |
| QList< QKeySequence > | keySequences (bool getAll=false) const |
Definition at line 36 of file qshortcutmap_p.h.
| typedef bool(* QShortcutMap::ContextMatcher) (QObject *object, Qt::ShortcutContext context) |
Definition at line 43 of file qshortcutmap_p.h.
| QShortcutMap::QShortcutMap | ( | ) |
QShortcutMap constructor.
Definition at line 107 of file qshortcutmap.cpp.
| QShortcutMap::~QShortcutMap | ( | ) |
QShortcutMap destructor.
Definition at line 116 of file qshortcutmap.cpp.
| int QShortcutMap::addShortcut | ( | QObject * | owner, |
| const QKeySequence & | keySequence, | ||
| Qt::ShortcutContext | context, | ||
| ContextMatcher | matcher ) |
Adds a shortcut to the global map. Returns the id of the newly added shortcut.
Definition at line 124 of file qshortcutmap.cpp.
| bool QShortcutMap::hasShortcutForKeySequence | ( | const QKeySequence & | seq | ) | const |
Determines if an enabled shortcut has a matching key sequence.
Definition at line 365 of file qshortcutmap.cpp.
| QList< QKeySequence > QShortcutMap::keySequences | ( | bool | getAll = false | ) | const |
Definition at line 610 of file qshortcutmap.cpp.
| int QShortcutMap::removeShortcut | ( | int | id, |
| QObject * | owner, | ||
| const QKeySequence & | keySequence = QKeySequence() ) |
Removes a shortcut from the global map. If owner is \nullptr, all entries in the map with the key sequence specified is removed. If key is null, all sequences for owner is removed from the map. If id is 0, any identical key sequences owned by owner are removed. Returns the number of sequences removed from the map.
Definition at line 148 of file qshortcutmap.cpp.
| int QShortcutMap::setShortcutAutoRepeat | ( | bool | on, |
| int | id, | ||
| QObject * | owner, | ||
| const QKeySequence & | keySequence = QKeySequence() ) |
Changes the auto repeat state of a shortcut to enable. If owner is \nullptr, all entries in the map with the key sequence specified is removed. If key is null, all sequences for owner is removed from the map. If id is 0, any identical key sequences owned by owner are changed. Returns the number of sequences which are matched in the map.
Definition at line 231 of file qshortcutmap.cpp.
| int QShortcutMap::setShortcutEnabled | ( | bool | enable, |
| int | id, | ||
| QObject * | owner, | ||
| const QKeySequence & | keySequence = QKeySequence() ) |
Changes the enable state of a shortcut to enable. If owner is \nullptr, all entries in the map with the key sequence specified is removed. If key is null, all sequences for owner is removed from the map. If id is 0, any identical key sequences owned by owner are changed. Returns the number of sequences which are matched in the map.
Definition at line 195 of file qshortcutmap.cpp.
| QKeySequence::SequenceMatch QShortcutMap::state | ( | ) |
Returns the current state of the statemachine
Definition at line 272 of file qshortcutmap.cpp.
| bool QShortcutMap::tryShortcut | ( | QKeyEvent * | e | ) |
Uses nextState(QKeyEvent) to check for a grabbed shortcut.
If so, it is dispatched using dispatchEvent().
Returns true if a shortcut handled the event.
Definition at line 287 of file qshortcutmap.cpp.