Public Types | Public Slots | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
pqShortcutDecorator Class Reference

Decorate a property widget by highlighting its frame when keyboard shortcuts are active. More...

#include <pqShortcutDecorator.h>

Inheritance diagram for pqShortcutDecorator:
Inheritance graph
[legend]
Collaboration diagram for pqShortcutDecorator:
Collaboration graph
[legend]

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
 
- Public Member Functions inherited from pqPropertyWidgetDecorator
 pqPropertyWidgetDecorator (vtkPVXMLElement *xml, pqPropertyWidget *parent)
 Constructor. More...
 
 ~pqPropertyWidgetDecorator () override
 
pqPropertyWidgetparentWidget () 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

pqPropertyWidgetpropertyWidget () 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...
 
- Protected Member Functions inherited from pqPropertyWidgetDecorator
vtkPVXMLElementxml () const
 

Protected Attributes

QList< QPointer< pqModalShortcut > > m_shortcuts
 
bool m_pressed
 
bool m_silent
 
bool m_allowRefocus
 

Additional Inherited Members

- Signals inherited from pqPropertyWidgetDecorator
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 Public Member Functions inherited from pqPropertyWidgetDecorator
static pqPropertyWidgetDecoratorcreate (vtkPVXMLElement *xml, pqPropertyWidget *parent)
 Creates a new decorator, given the xml config and the parent pqPropertyWidget for the decorator. More...
 

Detailed Description

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.

Member Typedef Documentation

◆ Superclass

Definition at line 25 of file pqShortcutDecorator.h.

Constructor & Destructor Documentation

◆ pqShortcutDecorator() [1/2]

pqShortcutDecorator::pqShortcutDecorator ( pqPropertyWidget parent)

◆ pqShortcutDecorator() [2/2]

pqShortcutDecorator::pqShortcutDecorator ( vtkPVXMLElement ,
pqPropertyWidget parent 
)

Member Function Documentation

◆ addShortcut()

void pqShortcutDecorator::addShortcut ( pqModalShortcut shortcut)

Add a shortcut the parent widget should respond to.

◆ isEnabled()

bool pqShortcutDecorator::isEnabled ( ) const

◆ setEnabled

virtual void pqShortcutDecorator::setEnabled ( bool  enable,
bool  refocusWhenEnabling = false 
)
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().

◆ onShortcutEnabled

virtual void pqShortcutDecorator::onShortcutEnabled ( )
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.

◆ onShortcutDisabled

virtual void pqShortcutDecorator::onShortcutDisabled ( )
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.

◆ propertyWidget()

pqPropertyWidget* pqShortcutDecorator::propertyWidget ( ) const
protected

The parent property widget (returned as a pqPropertyWidget, not QWidget).

◆ eventFilter()

bool pqShortcutDecorator::eventFilter ( QObject *  obj,
QEvent *  event 
)
overrideprotected

Monitor mouse events allowing users to enable/disable the parent-widget's shortcuts.

◆ markFrame()

void pqShortcutDecorator::markFrame ( bool  active,
const QColor &  frameColor 
)
protected

Show/hide and color the parent widget's frame.

Member Data Documentation

◆ m_shortcuts

QList<QPointer<pqModalShortcut> > pqShortcutDecorator::m_shortcuts
protected

Definition at line 85 of file pqShortcutDecorator.h.

◆ m_pressed

bool pqShortcutDecorator::m_pressed
protected

Definition at line 87 of file pqShortcutDecorator.h.

◆ m_silent

bool pqShortcutDecorator::m_silent
protected

Definition at line 89 of file pqShortcutDecorator.h.

◆ m_allowRefocus

bool pqShortcutDecorator::m_allowRefocus
protected

Definition at line 98 of file pqShortcutDecorator.h.


The documentation for this class was generated from the following file: