pqDoubleRangeWidget.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 pqDoubleRangeWidget_h
5 #define pqDoubleRangeWidget_h
6 
7 #include "pqDoubleSliderWidget.h"
8 #include "pqWidgetsModule.h"
9 #include <QWidget>
10 
15 class PQWIDGETS_EXPORT pqDoubleRangeWidget : public pqDoubleSliderWidget
16 {
17  Q_OBJECT
18  Q_PROPERTY(double minimum READ minimum WRITE setMinimum)
19  Q_PROPERTY(double maximum READ maximum WRITE setMaximum)
20  Q_PROPERTY(int resolution READ resolution WRITE setResolution)
21 
23 
24 public:
28  pqDoubleRangeWidget(QWidget* parent = nullptr);
29  ~pqDoubleRangeWidget() override;
30 
31  pqDoubleRangeWidget(QWidget* parent, double min, double max, double value);
32 
33  // get the min range value
34  double minimum() const;
35  // get the max range value
36  double maximum() const;
37 
38  // returns the resolution.
39  int resolution() const;
40 
41 public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
42  // set the min range value
43  void setMinimum(double);
44  // set the max range value
45  void setMaximum(double);
46 
47  // set the resolution.
48  void setResolution(int);
49 
50 protected:
51  int valueToSliderPos(double val) override;
52  double sliderPosToValue(int pos) override;
53 
54 private Q_SLOTS:
55  void updateValidator();
56 
57 private: // NOLINT(readability-redundant-access-specifiers)
58  int Resolution = 100;
59  double Minimum = 0;
60  double Maximum = 1;
61 };
62 
63 #endif
A widget with a tied slider and line edit for editing a double property.
Extends pqDoubleSliderWidget to use it with a range of doubles : provides control on min/max...
#define const
Definition: zconf.h:238