Vuo  2.0.3
VuoSliderWithLabels.hh
Go to the documentation of this file.
1 
10 #pragma once
11 
15 class VuoSliderWithLabels : public QSlider
16 {
17  Q_OBJECT
18 
19 public:
20  explicit VuoSliderWithLabels(QWidget *parent = 0);
21  QString getLabelTextForValue(int value);
22  void setLabelTextForValue(int value, QString text);
23  void setDisplayTicks(bool display);
24  void initialize();
25 
26 protected:
27  void paintEvent(QPaintEvent *e);
28 
29 private:
30  QLabel *minLabel;
31  QLabel *maxLabel;
32  map<int, QLabel *> intermediateLabels;
33  map<int, QString> labelTextForValue;
34  bool displayTicks;
35 
36  static const int extraVSpaceForTicks;
37  static const int minimumHeight;
38 };
39