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 
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  // get the min range value
32  double minimum() const;
33  // get the max range value
34  double maximum() const;
35 
36  // returns the resolution.
37  int resolution() const;
38 
39 public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
40  // set the min range value
41  void setMinimum(double);
42  // set the max range value
43  void setMaximum(double);
44 
45  // set the resolution.
46  void setResolution(int);
47 
48 protected:
49  int valueToSliderPos(double val) override;
50  double sliderPosToValue(int pos) override;
51 
52 private Q_SLOTS:
53  void updateValidator();
54 
55 private: // NOLINT(readability-redundant-access-specifiers)
56  int Resolution;
57  double Minimum;
58  double Maximum;
59 };
60 
61 #endif
A widget with a tied slider and line edit for editing a double property.
#define PQWIDGETS_EXPORT
Extends pqDoubleSliderWidget to use it with a range of doubles : provides control on min/max...
#define const
Definition: zconf.h:238