ENLIGHTEN
Cross-platform desktop GUI for Wasatch Photonics spectrometers
Loading...
Searching...
No Matches
floatcontrol.h
Go to the documentation of this file.
1
24
25#ifndef FLOATCONTROL_H
26#define FLOATCONTROL_H
27
28#include <QWidget>
29#include <QHBoxLayout>
30#include <QSlider>
31#include <QDoubleSpinBox>
32
33class FloatControl : public QWidget
34{
35 Q_OBJECT
36public:
37 explicit FloatControl(QWidget* parent = nullptr);
38
39 void SetValue(double value);
40 void SetRange(std::pair<double, double> range);
41
42 double Value() const;
43
44private:
45 QHBoxLayout* m_layout{};
46 QSlider* m_slider{};
47 QDoubleSpinBox* m_spinBox{};
48
49 constexpr static double m_sliderFInc = 1'000.0;
50
51signals:
52 void ValueChanged(double value);
53};
54
55
56#endif // FLOATCONTROL_H
QDoubleSpinBox * m_spinBox
Definition floatcontrol.h:47
QHBoxLayout * m_layout
Definition floatcontrol.h:45
static constexpr double m_sliderFInc
Definition floatcontrol.h:49
double Value() const
Definition floatcontrol.cpp:72
FloatControl(QWidget *parent=nullptr)
Definition floatcontrol.cpp:27
void ValueChanged(double value)
void SetValue(double value)
Definition floatcontrol.cpp:56
QSlider * m_slider
Definition floatcontrol.h:46
void SetRange(std::pair< double, double > range)
Definition floatcontrol.cpp:61