forked from mrkite/minutor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
labelledslider.h
47 lines (34 loc) · 865 Bytes
/
labelledslider.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/** Copyright (c) 2013, Sean Kasun */
#ifndef LABELLEDSLIDER_H_
#define LABELLEDSLIDER_H_
#include <QWidget>
#include <QSlider>
#include <QLabel>
#include <QWheelEvent>
#include <QKeyEvent>
class MSlider : public QSlider {
Q_OBJECT
public:
explicit MSlider(Qt::Orientation orientation, QWidget *parent = 0);
public slots:
void wheelEvent(QWheelEvent *event);
};
class LabelledSlider : public QWidget {
Q_OBJECT
public:
explicit LabelledSlider(Qt::Orientation orientation, QWidget *parent = 0);
int value() const;
signals:
void valueChanged(int val);
public slots:
void setValue(int val); // set absolute
void changeValue(int val); // change relative
private slots:
void intValueChange(int val);
protected:
void wheelEvent(QWheelEvent *event);
private:
MSlider *slider;
QLabel *label;
};
#endif // LABELLEDSLIDER_H_