pqDiscreteDoubleWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: pqDiscreteDoubleWidget.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 #ifndef pqDiscreteDoubleWidget_h
16 #define pqDiscreteDoubleWidget_h
17 
18 #include "pqDoubleSliderWidget.h"
19 
20 #include <QVector>
21 #include <QWidget>
22 
27 {
29  Q_OBJECT
30  Q_PROPERTY(double value READ value WRITE setValue USER true)
31 
32 public:
33  pqDiscreteDoubleWidget(QWidget* parent = nullptr);
34  ~pqDiscreteDoubleWidget() override;
35 
39  std::vector<double> values() const;
40  void setValues(std::vector<double> values);
41 
42 protected:
43  int valueToSliderPos(double val) override;
44  double sliderPosToValue(int pos) override;
45 
46 private:
47  QVector<double> Values;
48 };
49 
50 #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)