Decorate a property widget by highlighting its frame when keyboard shortcuts are active. More...
#include <pqShortcutDecorator.h>
Public Types | |
using | Superclass = pqPropertyWidgetDecorator |
Public Slots | |
virtual void | setEnabled (bool enable, bool refocusWhenEnabling=false) |
Called to force all shortcuts for the attached property widget to enable/disable. More... | |
Public Member Functions | |
pqShortcutDecorator (pqPropertyWidget *parent) | |
pqShortcutDecorator (vtkPVXMLElement *, pqPropertyWidget *parent) | |
void | addShortcut (pqModalShortcut *shortcut) |
Add a shortcut the parent widget should respond to. More... | |
bool | isEnabled () const |
![]() | |
pqPropertyWidgetDecorator (vtkPVXMLElement *xml, pqPropertyWidget *parent) | |
Constructor. More... | |
~pqPropertyWidgetDecorator () override | |
pqPropertyWidget * | parentWidget () const |
Returns the pqPropertyWidget parent. More... | |
virtual bool | canShowWidget (bool show_advanced) const |
Override this method to override the visibility of the widget in the panel. More... | |
virtual bool | enableWidget () const |
Override this method to override the enable state of the widget in the panel. More... | |
Protected Slots | |
virtual void | onShortcutEnabled () |
Called when any shortcut is enabled (and will enable them all and mark the widget). More... | |
virtual void | onShortcutDisabled () |
Called when any shortcut is disabled (and will disable them all and mark the widget). More... | |
Protected Member Functions | |
pqPropertyWidget * | propertyWidget () const |
The parent property widget (returned as a pqPropertyWidget, not QWidget). More... | |
bool | eventFilter (QObject *obj, QEvent *event) override |
Monitor mouse events allowing users to enable/disable the parent-widget's shortcuts. More... | |
void | markFrame (bool active, const QColor &frameColor) |
Show/hide and color the parent widget's frame. More... | |
![]() | |
vtkPVXMLElement * | xml () const |
Protected Attributes | |
QList< QPointer< pqModalShortcut > > | m_shortcuts |
bool | m_pressed |
bool | m_silent |
bool | m_allowRefocus |
Additional Inherited Members | |
![]() | |
void | visibilityChanged () |
This signal is fired whenever the decorator has determined that the panel may need a refresh since the state of the system has changed which would deem changes in the widget visibility or enable state. More... | |
void | enableStateChanged () |
![]() | |
static pqPropertyWidgetDecorator * | create (vtkPVXMLElement *xml, pqPropertyWidget *parent) |
Creates a new decorator, given the xml config and the parent pqPropertyWidget for the decorator. More... | |
Decorate a property widget by highlighting its frame when keyboard shortcuts are active.
This also monitors enter/exit/mouse events to let users activate/deactivate the widget's keyboard shortcuts.
Definition at line 20 of file pqShortcutDecorator.h.
Definition at line 25 of file pqShortcutDecorator.h.
pqShortcutDecorator::pqShortcutDecorator | ( | pqPropertyWidget * | parent | ) |
pqShortcutDecorator::pqShortcutDecorator | ( | vtkPVXMLElement * | , |
pqPropertyWidget * | parent | ||
) |
void pqShortcutDecorator::addShortcut | ( | pqModalShortcut * | shortcut | ) |
Add a shortcut the parent widget should respond to.
bool pqShortcutDecorator::isEnabled | ( | ) | const |
|
virtualslot |
Called to force all shortcuts for the attached property widget to enable/disable.
This is tied internally to pqPropertyWidget::widgetVisibilityUpdated, which passes a boolean state so that shortcuts are disabled when the widget is not visible and the widget grabs shortcuts when it becomes visible.
If refocusWhenEnabling is true, and if an enabled shortcut has a context widget, the keyboard focus will shift to that widget (so that users can immediately use it). This parameter is false by default and should only be enabled when direct user interaction with the decorated frame is what causes the call to setEnabled().
|
protectedvirtualslot |
Called when any shortcut is enabled (and will enable them all and mark the widget).
When new shortcuts are added to a property widget, this ensures any existing ones are also activated so the state is consistent.
|
protectedvirtualslot |
Called when any shortcut is disabled (and will disable them all and mark the widget).
When an individual shortcut is disabled (usually because a separate widget has taken possession of it), this ensures any other shortcuts for this widget are also deactivated so the state is consistent.
|
protected |
The parent property widget (returned as a pqPropertyWidget, not QWidget).
|
overrideprotected |
Monitor mouse events allowing users to enable/disable the parent-widget's shortcuts.
|
protected |
Show/hide and color the parent widget's frame.
|
protected |
Definition at line 85 of file pqShortcutDecorator.h.
|
protected |
Definition at line 87 of file pqShortcutDecorator.h.
|
protected |
Definition at line 89 of file pqShortcutDecorator.h.
|
protected |
Definition at line 98 of file pqShortcutDecorator.h.