VAPOR3 3.9.4
RangeCombos.h
Go to the documentation of this file.
1#ifdef WIN32
2 #pragma warning(disable : 4100)
3#endif
4
5#ifndef RANGECOMBOS_H
6 #define RANGECOMBOS_H
7
8 #include <QWidget>
9 #include "Combo.h"
10
11 // Fix for Qt bug https://bugreports.qt.io/browse/QTBUG-98093
12 // Apply a style sheet to QSlider to make it work on OSX Monterey
13 #ifdef Darwin
14 #include "QMontereySlider.h"
15 #define QSlider QMontereySlider
16 #endif
17
18QT_BEGIN_NAMESPACE
19class QComboBox;
20class QGroupBox;
21class QLineEdit;
22class QSlider;
23class QValidator;
24QT_END_NAMESPACE
25
26//
27// class RangeCombo
28//
29// This class manages a pair of Combo objects, one for
30// a minimum value and one for a maximum value. The class ensures that
31// the minimum is always less than or equal to the maximum by making
32// adjustments as necessary.
33//
34class RangeCombo : public QWidget {
35 Q_OBJECT
36
37public:
38 RangeCombo(Combo *minWidget, Combo *maxWidget);
39
40 // This method must be called whenever the minimax or maximum allowable
41 // valid value changes, or the current minimum or maximum value
42 // is changed externally. I.e. Update() provides a means to change
43 // the internal state of the class. If minValid > maxValid, maxValid
44 // will be set to minValid. If minValue or maxValid is outside of
45 // minValid and maxValid it will be set to minValid. if minValue is
46 // greater than maxValue, maxValue will be set to minValue
47 //
48 void Update(double minValid, double maxValid, double minValue, double maxValue);
49
50 QSlider * GetSliderMin() const { return (_minWidget->GetSlider()); };
51 QLineEdit *GetLineEditMin() const { return (_minWidget->GetLineEdit()); };
52
53 QSlider * GetSliderMax() const { return (_maxWidget->GetSlider()); };
54 QLineEdit *GetLineEditMax() const { return (_maxWidget->GetLineEdit()); };
55
56public slots:
57 void setValueMin(double);
58 void setValueMax(double);
59
60signals:
61 void valueChanged(double minValue, double maxValue);
62
63private:
64 Combo *_minWidget;
65 Combo *_maxWidget;
66};
67
68#endif
Definition: Combo.h:22
QLineEdit * GetLineEdit() const
Definition: Combo.h:45
QSlider * GetSlider() const
Definition: Combo.h:41
void Update(double minValid, double maxValid, double minValue, double maxValue)
QSlider * GetSliderMax() const
Definition: RangeCombos.h:53
QSlider * GetSliderMin() const
Definition: RangeCombos.h:50
void setValueMin(double)
QLineEdit * GetLineEditMin() const
Definition: RangeCombos.h:51
RangeCombo(Combo *minWidget, Combo *maxWidget)
QLineEdit * GetLineEditMax() const
Definition: RangeCombos.h:54
void valueChanged(double minValue, double maxValue)
void setValueMax(double)