-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy pathqthumbwheel.h
65 lines (51 loc) · 1.52 KB
/
qthumbwheel.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// -*- C++ -*-
#ifndef QTHUMBWHEEL_H
#define QTHUMBWHEEL_H
#include <QtGlobal>
#include <QAbstractSlider>
#include <QSize>
#include <QWidget>
class QMouseEvent;
class QPaintEvent;
class QResizeEvent;
// Reimplemented the thumbwheel widget from qt solutions from scratch.
// http://doc.trolltech.com/solutions/4/qtthumbwheel/qtthumbwheel.html.
// Note: limitedDrag does nothing.
class QThumbWheel : public QAbstractSlider
{
Q_OBJECT
Q_PROPERTY(int cogCount
READ cogCount WRITE setCogCount)
Q_PROPERTY(double transmissionRatio
READ transmissionRatio WRITE setTransmissionRatio)
Q_PROPERTY(bool wrapsAround
READ wrapsAround WRITE setWrapsAround)
public:
QThumbWheel(QWidget *parent = 0);
QThumbWheel(int mi, int ma, int st, int v, Qt::Orientation o, QWidget *p=0);
~QThumbWheel();
int cogCount();
double transmissionRatio();
bool wrapsAround();
public slots:
void setCogCount(int);
void setTransmissionRatio(double);
void setWrapsAround(bool);
protected:
QSize sizeHint() const;
QSize minimumSizeHint() const;
void resizeEvent(QResizeEvent *);
void paintEvent(QPaintEvent*);
void mousePressEvent(QMouseEvent*);
void mouseReleaseEvent(QMouseEvent*);
void mouseMoveEvent(QMouseEvent*);
private:
struct Private;
Private *d;
};
#endif
/* -------------------------------------------------------------
Local Variables:
c++-font-lock-extra-types: ( "\\sw+_t" "[A-Z]\\sw*[a-z]\\sw*" )
End:
------------------------------------------------------------- */