![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Manage key sequences used for shortcuts. More...
#include <ecvKeySequences.h>


Public Member Functions | |
| ecvModalShortcut * | active (const QKeySequence &keySequence) const |
| ecvModalShortcut * | addModalShortcut (const QKeySequence &keySequence, QAction *action, QWidget *parent) |
| void | reorder (ecvModalShortcut *target) |
| void | dumpShortcuts (const QKeySequence &keySequence) const |
Static Public Member Functions | |
| static ecvKeySequences & | instance () |
Protected Slots | |
| virtual void | disableSiblings () |
| virtual void | enableNextSibling () |
| virtual void | removeModalShortcut () |
Protected Member Functions | |
| ecvKeySequences (QObject *parent) | |
| ~ecvKeySequences () override=default | |
Protected Attributes | |
| 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:
Usage:
Definition at line 39 of file ecvKeySequences.h.
|
protected |
Definition at line 58 of file ecvKeySequences.cpp.
References CVLog::PrintVerbose().
|
overrideprotecteddefault |
| ecvModalShortcut * ecvKeySequences::active | ( | const QKeySequence & | keySequence | ) | const |
Return the active shortcut for a given key sequence (if any).
Definition at line 64 of file ecvKeySequences.cpp.
| ecvModalShortcut * ecvKeySequences::addModalShortcut | ( | const QKeySequence & | keySequence, |
| QAction * | action, | ||
| QWidget * | parent | ||
| ) |
Register a modal shortcut with the manager.
| keySequence | The key combination to listen for |
| action | The action to trigger (optional) |
| parent | The context widget (optional) |
Definition at line 83 of file ecvKeySequences.cpp.
References disableSiblings(), ecvModalShortcut::enabled(), CVLog::PrintVerbose(), removeModalShortcut(), ecvModalShortcut::unregister(), and CVLog::Warning().
Referenced by cvPointPickingHelper::cvPointPickingHelper().
|
protectedvirtualslot |
Called when a shortcut is enabled to ensure siblings are disabled.
Definition at line 187 of file ecvKeySequences.cpp.
References m_silence, and CVLog::PrintVerbose().
Referenced by addModalShortcut().
| void ecvKeySequences::dumpShortcuts | ( | const QKeySequence & | keySequence | ) | const |
Dump a list of shortcuts registered for a given key sequence (debug).
Definition at line 161 of file ecvKeySequences.cpp.
References CVLog::Print(), and CVLog::PrintVerbose().
|
protectedvirtualslot |
Not currently used. Intended for use enabling next-most-recently-used shortcut.
Definition at line 229 of file ecvKeySequences.cpp.
References m_silence, and CVLog::PrintVerbose().
|
static |
Get the singleton instance.
Definition at line 52 of file ecvKeySequences.cpp.
Referenced by cvPointPickingHelper::cvPointPickingHelper(), and ecvShortcutDecorator::eventFilter().
|
protectedvirtualslot |
Called when shortcuts are deleted to disable and unregister them.
Definition at line 300 of file ecvKeySequences.cpp.
References CVLog::PrintVerbose().
Referenced by addModalShortcut().
| void ecvKeySequences::reorder | ( | ecvModalShortcut * | target | ) |
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.
Definition at line 123 of file ecvKeySequences.cpp.
References ecvModalShortcut::isEnabled(), ecvModalShortcut::keySequence(), and CVLog::PrintVerbose().
Referenced by ecvShortcutDecorator::eventFilter().
|
protected |
Set true in slot implementations to avoid signal/slot recursion.
Definition at line 106 of file ecvKeySequences.h.
Referenced by disableSiblings(), and enableNextSibling().