pqDiscreteDoubleWidget.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
3 #ifndef pqDiscreteDoubleWidget_h
4 #define pqDiscreteDoubleWidget_h
5 
6 #include "pqDoubleSliderWidget.h"
7 
8 #include <QVector>
9 #include <QWidget>
10 
15 {
17  Q_OBJECT
18  Q_PROPERTY(double value READ value WRITE setValue USER true)
19 
20 public:
21  pqDiscreteDoubleWidget(QWidget* parent = nullptr);
22  ~pqDiscreteDoubleWidget() override;
23 
27  std::vector<double> values() const;
28  void setValues(std::vector<double> values);
29 
30 protected:
31  int valueToSliderPos(double val) override;
32  double sliderPosToValue(int pos) override;
33 
34 private:
35  QVector<double> Values;
36 };
37 
38 #endif // pqDiscreteDoubleWidget_h
Customize pqDoubleSliderWidget to use a custom set of allowed values.
A widget with a tied slider and line edit for editing a double property.
#define PQWIDGETS_EXPORT
virtual int valueToSliderPos(double val)
virtual double sliderPosToValue(int pos)