VAPOR3 3.9.4
VSlider.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
5#include <QWidget>
6#include <QSlider>
7
8#include "VHBoxWidget.h"
9
10// Fix for Qt bug https://bugreports.qt.io/browse/QTBUG-98093
11// Apply a style sheet to QSlider to make it work on OSX Monterey
12#ifdef Darwin
13 #include "QMontereySlider.h"
14 #define QSlider QMontereySlider
15#endif
16
21
22class VSlider : public VHBoxWidget {
23 Q_OBJECT
24
25public:
26 VSlider(double min = 0, double max = 1);
27
28 double GetValue() const;
29 void SetValue(double value);
30
31 double GetMinimum() const;
32 void SetMinimum(double min);
33
34 double GetMaximum() const;
35 void SetMaximum(double max);
36
37 void SetRange(double min, double max);
38
39private:
40 QSlider *_slider;
41 double _min;
42 double _max;
43 double _stepSize;
44
45private slots:
46 void _sliderChanged();
47 void _sliderChangedIntermediate(int position);
48
49signals:
50 void ValueChanged(double value);
51 void ValueChangedIntermediate(double value);
52};
53
54class ScrollWheelEater : public QObject {
55 Q_OBJECT
56
57protected:
58 bool eventFilter(QObject *obj, QEvent *event) override;
59};
bool eventFilter(QObject *obj, QEvent *event) override
void ValueChanged(double value)
double GetMaximum() const
void SetMinimum(double min)
double GetValue() const
double GetMinimum() const
void ValueChangedIntermediate(double value)
void SetMaximum(double max)
void SetRange(double min, double max)
VSlider(double min=0, double max=1)
void SetValue(double value)