Manage an action and/or widget's responsivity to a shortcut.
More...
#include <pqModalShortcut.h>
Inherits QObject.
Manage an action and/or widget's responsivity to a shortcut.
This object will add and remove a connection between a widget/action and a QShortcut as required by the pqKeySequences manager to prevent any ambiguous activations.
Definition at line 21 of file pqModalShortcut.h.
◆ Superclass
◆ ~pqModalShortcut()
pqModalShortcut::~pqModalShortcut |
( |
| ) |
|
|
override |
◆ pqModalShortcut()
pqModalShortcut::pqModalShortcut |
( |
const QKeySequence & |
key, |
|
|
QAction * |
action = nullptr , |
|
|
QWidget * |
parent = nullptr |
|
) |
| |
|
protected |
◆ setContextWidget()
void pqModalShortcut::setContextWidget |
( |
QWidget * |
contextWidget, |
|
|
Qt::ShortcutContext |
contextArea = Qt::WindowShortcut |
|
) |
| |
If the shortcut should be restricted to a particular widget (such as a pqView), use this method to set and update the widget during the life of the pqModalShortcut.
◆ isEnabled()
bool pqModalShortcut::isEnabled |
( |
| ) |
const |
◆ setEnabled()
void pqModalShortcut::setEnabled |
( |
bool |
shouldEnable, |
|
|
bool |
changeFocus = true |
|
) |
| |
◆ keySequence()
QKeySequence pqModalShortcut::keySequence |
( |
| ) |
const |
◆ enabled
void pqModalShortcut::enabled |
( |
| ) |
|
|
signal |
Called from setEnabled() whenever it is passed true.
This is used by pqKeySequences to disable any sibling shortcuts with the same keysequence.
This may also be used by widgets to update their visual state, indicating they are now accepting shortcuts.
◆ disabled
void pqModalShortcut::disabled |
( |
| ) |
|
|
signal |
Called from setEnabled() whenever it is passed false.
This may be used by widgets to update their visual state, indicating they are no longer accepting shortcuts.
◆ unregister
void pqModalShortcut::unregister |
( |
| ) |
|
|
signal |
Called from the destructor.
This is used by pqKeySequences to clean its records.
◆ activated
void pqModalShortcut::activated |
( |
| ) |
|
|
signal |
Invoked when the key sequence is pressed.
◆ pqKeySequences
◆ m_key
QKeySequence pqModalShortcut::m_key |
|
protected |
◆ m_shortcut
QPointer<QShortcut> pqModalShortcut::m_shortcut |
|
protected |
◆ m_action
QPointer<QAction> pqModalShortcut::m_action |
|
protected |
The documentation for this class was generated from the following file: