0cbd3823e
김태훈
슬라이더 새로 구현
|
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
|
#ifndef SLIDER_H
#define SLIDER_H
#include <QWidget>
#include <QPixmap>
class Slider : public QWidget
{
Q_OBJECT
bool isSliderDown_;
int sliderPosition_;
int value_;
int minimum_;
int maximum_;
QPixmap groove;
QPixmap sub;
QPixmap handle;
int grooveMin;
int grooveMax;
QPoint groovePoint;
QPoint subPoint;
|
a2de3cbfc
김태훈
수동 요리에 새 슬라이더 적용
|
26
|
bool subVisible_;
|
0cbd3823e
김태훈
슬라이더 새로 구현
|
27
28
29
30
31
|
public:
explicit Slider(QWidget *parent = 0);
void setSubPixmap(const QPixmap &pixmap);
void setSubPixmap(const QString &fileName);
|
a2de3cbfc
김태훈
수동 요리에 새 슬라이더 적용
|
32
|
void setSubVisible(bool visible);
|
0cbd3823e
김태훈
슬라이더 새로 구현
|
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
void setRange(int min, int max);
void setMinimum(int min);
void setMaximum(int max);
int value();
int minimum();
int maximum();
bool isSliderDown();
int sliderPosition();
void setSliderPosition(int value);
QList<int> ticks;
QList<int> bigTicks;
|
a2de3cbfc
김태훈
수동 요리에 새 슬라이더 적용
|
48
49
|
int tickInterval;
int bigTickInterval;
|
0cbd3823e
김태훈
슬라이더 새로 구현
|
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
protected:
virtual void mouseMoveEvent(QMouseEvent *event);
virtual void mousePressEvent(QMouseEvent *event);
virtual void mouseReleaseEvent(QMouseEvent *event);
virtual void paintEvent(QPaintEvent *event);
virtual void resizeEvent(QResizeEvent *event);
private:
int calcSliderPosition(int mouseX);
int calcSubLength(int value);
void updatePixmapPosition();
signals:
void sliderMoved(int value);
void valueChanged(int value);
public slots:
void setValue(int value);
};
#endif // SLIDER_H
|