src
paraview-5.12
Qt
Components
pqShortcutDecorator.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2
// SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3
// SPDX-License-Identifier: BSD-3-Clause
4
5
#ifndef pqShortcutDecorator_h
6
#define pqShortcutDecorator_h
7
8
#include "
pqPropertyWidgetDecorator.h
"
9
10
class
pqModalShortcut
;
11
12
class
QColor;
13
20
class
PQCOMPONENTS_EXPORT
pqShortcutDecorator
:
public
pqPropertyWidgetDecorator
21
{
22
Q_OBJECT;
23
24
public
:
25
using
Superclass =
pqPropertyWidgetDecorator
;
26
pqShortcutDecorator
(
pqPropertyWidget
* parent);
27
pqShortcutDecorator
(
vtkPVXMLElement
*,
pqPropertyWidget
* parent);
28
32
void
addShortcut(
pqModalShortcut
* shortcut);
33
34
bool
isEnabled()
const
;
35
36
public
Q_SLOTS:
// NOLINT(readability-redundant-access-specifiers)
50
virtual
void
setEnabled(
bool
enable,
bool
refocusWhenEnabling =
false
);
51
52
protected
Q_SLOTS:
59
virtual
void
onShortcutEnabled();
67
virtual
void
onShortcutDisabled();
68
69
protected
:
// NOLINT(readability-redundant-access-specifiers)
73
pqPropertyWidget
* propertyWidget()
const
;
77
bool
eventFilter(QObject* obj, QEvent* event)
override
;
81
void
markFrame(
bool
active,
const
QColor& frameColor);
82
83
// All the shortcuts that decorate the property widget.
84
// These will all be enabled/disabled en banc.
85
QList<QPointer<pqModalShortcut>>
m_shortcuts
;
86
// Note when the user has pressed the mouse inside the widget and not released it.
87
bool
m_pressed
;
88
// Prevent recursive signaling inside onShortcutEnabled/onShortcutDisabled.
89
bool
m_silent
;
90
// Should shortcuts set the keyboard focus to their context widget?
91
// This is set to true when users explicitly click on the widget frame
92
// and false otherwise (so that programmatic changes to the widget made
93
// in response to other events do not interrupt a user; for example,
94
// using the arrow keys in the pipeline browser to change pipelines
95
// should not move the keyboard focus away from the pipeline browser).
96
// Note that this only applies when enabling shortcuts (since disabling
97
// a shortcut would never require a refocus).
98
bool
m_allowRefocus
;
99
};
100
101
#endif // pqShortcutDecorator_h
pqPropertyWidgetDecorator::pqPropertyWidgetDecorator
pqPropertyWidgetDecorator(vtkPVXMLElement *xml, pqPropertyWidget *parent)
Constructor.
pqShortcutDecorator::m_silent
bool m_silent
Definition:
pqShortcutDecorator.h:89
pqModalShortcut
Manage an action and/or widget's responsivity to a shortcut.
Definition:
pqModalShortcut.h:21
pqPropertyWidget
pqPropertyWidget represents a widget created for each property of a proxy on the pqPropertiesPanel (f...
Definition:
pqPropertyWidget.h:25
pqShortcutDecorator::m_shortcuts
QList< QPointer< pqModalShortcut > > m_shortcuts
Definition:
pqShortcutDecorator.h:85
pqPropertyWidgetDecorator.h
pqShortcutDecorator::m_allowRefocus
bool m_allowRefocus
Definition:
pqShortcutDecorator.h:98
pqPropertyWidgetDecorator
pqPropertyWidgetDecorator provides a mechanism to decorate pqPropertyWidget instances to add logic to...
Definition:
pqPropertyWidgetDecorator.h:19
pqShortcutDecorator::m_pressed
bool m_pressed
Definition:
pqShortcutDecorator.h:87
pqShortcutDecorator
Decorate a property widget by highlighting its frame when keyboard shortcuts are active.
Definition:
pqShortcutDecorator.h:20
vtkPVXMLElement
Definition:
vtkPVXMLElement.h:23
Generated by
1.8.17 on Wed Mar 27 2024