-
Notifications
You must be signed in to change notification settings - Fork 2
/
qcocoaslider.cpp
62 lines (46 loc) · 1.27 KB
/
qcocoaslider.cpp
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
#include "pch.h"
#include "qcocoaslider.h"
#include <QSlider>
class QCocoaSliderPrivate : public QObject
{
public:
QCocoaSliderPrivate(QCocoaSlider *slider, QSlider *sliderReal)
: QObject(slider), realSlider(sliderReal) {}
QPointer<QSlider> realSlider;
};
QCocoaSlider::QCocoaSlider(QWidget * parent /*= 0*/) : QCocoaWidget(parent)
{
QSlider *slider = new QSlider(this);
connect(slider, SIGNAL(valueChanged(int)), this, SIGNAL(valueChanged(int)));
pimpl = new QCocoaSliderPrivate(this, slider);
QVBoxLayout *layout = new QVBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(slider);
}
QSize QCocoaSlider::sizeHint() const
{
return pimpl->realSlider->sizeHint();
}
void QCocoaSlider::setSliderType(SliderType type /*= LinearSlider*/)
{
}
void QCocoaSlider::setRange(int min, int max)
{
pimpl->realSlider->setRange(min, max);
}
void QCocoaSlider::setOrientation(Qt::Orientation orientation)
{
pimpl->realSlider->setOrientation(orientation);
}
void QCocoaSlider::setValue(int value)
{
pimpl->realSlider->setValue(value);
}
void QCocoaSlider::setMaximum(int maxValue)
{
pimpl->realSlider->setMaximum(maxValue);
}
void QCocoaSlider::setMinimum(int minValue)
{
pimpl->realSlider->setMinimum(minValue);
}