Manage key sequences used for shortcuts.
More...
#include <ecvKeySequences.h>
|
| bool | m_silence |
| | Set true in slot implementations to avoid signal/slot recursion. More...
|
| |
Manage key sequences used for shortcuts.
ParaView-style modal shortcut manager that prevents ambiguous activation by ensuring only one listener is active for each key sequence at a time.
Key features:
- Automatic mutual exclusion: when one shortcut is enabled, all siblings are disabled
- Visual feedback: widgets can show which one currently owns a shortcut
- Context awareness: shortcuts can be limited to specific widgets
Usage:
QKeySequence(Qt::Key_S), myAction, myWidget);
ecvModalShortcut * addModalShortcut(const QKeySequence &keySequence, QAction *action, QWidget *parent)
static ecvKeySequences & instance()
Definition at line 39 of file ecvKeySequences.h.
◆ ecvKeySequences()
| ecvKeySequences::ecvKeySequences |
( |
QObject * |
parent | ) |
|
|
protected |
◆ ~ecvKeySequences()
| ecvKeySequences::~ecvKeySequences |
( |
| ) |
|
|
overrideprotecteddefault |
◆ active()
| ecvModalShortcut* ecvKeySequences::active |
( |
const QKeySequence & |
keySequence | ) |
const |
Return the active shortcut for a given key sequence (if any).
◆ addModalShortcut()
| ecvModalShortcut* ecvKeySequences::addModalShortcut |
( |
const QKeySequence & |
keySequence, |
|
|
QAction * |
action, |
|
|
QWidget * |
parent |
|
) |
| |
Register a modal shortcut with the manager.
- Parameters
-
| keySequence | The key combination to listen for |
| action | The action to trigger (optional) |
| parent | The context widget (optional) |
- Returns
- The created modal shortcut (owned by the manager)
◆ disableSiblings
| virtual void ecvKeySequences::disableSiblings |
( |
| ) |
|
|
protectedvirtualslot |
Called when a shortcut is enabled to ensure siblings are disabled.
◆ dumpShortcuts()
| void ecvKeySequences::dumpShortcuts |
( |
const QKeySequence & |
keySequence | ) |
const |
Dump a list of shortcuts registered for a given key sequence (debug).
◆ enableNextSibling
| virtual void ecvKeySequences::enableNextSibling |
( |
| ) |
|
|
protectedvirtualslot |
Not currently used. Intended for use enabling next-most-recently-used shortcut.
◆ instance()
Get the singleton instance.
◆ removeModalShortcut
| virtual void ecvKeySequences::removeModalShortcut |
( |
| ) |
|
|
protectedvirtualslot |
Called when shortcuts are deleted to disable and unregister them.
◆ reorder()
Ask the manager to reorder shortcuts so that the currently-active one becomes the "next" in line to the passed target.
** NB: This method is currently a placeholder. **
Widgets should call this method before invoking ecvModalShortcut::setEnabled in response to user input.
This method has no effect if no sibling of target is active at the time it is invoked.
◆ m_silence
| bool ecvKeySequences::m_silence |
|
protected |
Set true in slot implementations to avoid signal/slot recursion.
Definition at line 106 of file ecvKeySequences.h.
The documentation for this class was generated from the following file: