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;
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;
90  vtkEventQtSlotConnect* DomainConnection;
91  bool InteractingWithSlider;
92  bool DeferredValueEdited;
93 };
94 
95 #endif
type specific extension to vtkSMRangeDomainTemplate for ints.
a widget with a tied slider and line edit for editing a int property
#define PQCOMPONENTS_EXPORT
pqLineEdit is a specialization of QLineEdit which provide a new property &#39;text2&#39;. ...
Definition: pqLineEdit.h:25
#define const
Definition: zconf.h:238