Qt
Components
pqIntRangeWidget.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
#ifndef pqIntRangeWidget_h
5
#define pqIntRangeWidget_h
6
7
#include "
pqComponentsModule.h
"
8
#include "
vtkSmartPointer.h
"
9
#include <QWidget>
10
11
class
QSlider;
12
class
pqLineEdit
;
13
class
vtkSMIntRangeDomain
;
14
class
vtkEventQtSlotConnect
;
15
19
class
PQCOMPONENTS_EXPORT
pqIntRangeWidget
:
public
QWidget
20
{
21
Q_OBJECT
22
Q_PROPERTY(
int
value READ value WRITE setValue USER
true
)
23
Q_PROPERTY(
int
minimum READ minimum WRITE setMinimum)
24
Q_PROPERTY(
int
maximum READ maximum WRITE setMaximum)
25
26
public:
30
pqIntRangeWidget
(QWidget* parent =
nullptr
);
31
~
pqIntRangeWidget
() override;
32
36
int
value()
const
;
37
38
// get the min range value
39
int
minimum() const;
40
// get the max range value
41
int
maximum() const;
42
43
// Sets the range domain to monitor. This will automatically update
44
// the widgets range when the domain changes.
45
void
setDomain(
vtkSMIntRangeDomain
* domain);
46
47
Q_SIGNALS:
51
void
valueChanged(
int
);
52
58
void
valueEdited(
int
);
59
60
public Q_SLOTS:
64
void
setValue(
int
);
65
66
// set the min range value
67
void
setMinimum(
int
);
68
// set the max range value
69
void
setMaximum(
int
);
70
71
private Q_SLOTS:
72
void
sliderChanged(
int
);
73
void
textChanged(const QString&);
74
void
editingFinished();
75
void
updateValidator();
76
void
domainChanged();
77
void
emitValueEdited();
78
void
emitIfDeferredValueEdited();
79
void
sliderPressed();
80
void
sliderReleased();
81
82
private:
// NOLINT(readability-redundant-access-specifiers)
83
int
Value;
84
int
Minimum;
85
int
Maximum;
86
QSlider* Slider;
87
pqLineEdit
* LineEdit;
88
bool
BlockUpdate;
89
vtkSmartPointer
<
vtkSMIntRangeDomain
> Domain;
90
vtkEventQtSlotConnect
* DomainConnection;
91
bool
InteractingWithSlider;
92
bool
DeferredValueEdited;
93
};
94
95
#endif
pqComponentsModule.h
vtkSMIntRangeDomain
type specific extension to vtkSMRangeDomainTemplate for ints.
Definition:
vtkSMIntRangeDomain.h:27
pqIntRangeWidget
a widget with a tied slider and line edit for editing a int property
Definition:
pqIntRangeWidget.h:19
PQCOMPONENTS_EXPORT
#define PQCOMPONENTS_EXPORT
Definition:
pqComponentsModule.h:15
vtkSmartPointer
vtkEventQtSlotConnect
pqLineEdit
pqLineEdit is a specialization of QLineEdit which provide a new property 'text2'. ...
Definition:
pqLineEdit.h:25
vtkSmartPointer.h
const
#define const
Definition:
zconf.h:238
Generated by
1.8.13 on Tue Oct 1 2024