1 | // %flair:license{
|
---|
2 | // This file is part of the Flair framework distributed under the
|
---|
3 | // CECILL-C License, Version 1.0.
|
---|
4 | // %flair:license}
|
---|
5 | #ifndef _SCROLLBAR_H
|
---|
6 | #define _SCROLLBAR_H 1
|
---|
7 |
|
---|
8 | #include <qscrollbar.h>
|
---|
9 |
|
---|
10 | class ScrollBar : public QScrollBar {
|
---|
11 | Q_OBJECT
|
---|
12 |
|
---|
13 | public:
|
---|
14 | ScrollBar(QWidget *parent = NULL);
|
---|
15 | ScrollBar(Qt::Orientation, QWidget *parent = NULL);
|
---|
16 | ScrollBar(float minBase, float maxBase, Qt::Orientation o,
|
---|
17 | QWidget *parent = NULL);
|
---|
18 |
|
---|
19 | void setInverted(bool);
|
---|
20 | bool isInverted(void) const;
|
---|
21 |
|
---|
22 | float minBaseValue(void) const;
|
---|
23 | float maxBaseValue(void) const;
|
---|
24 |
|
---|
25 | float minSliderValue(void) const;
|
---|
26 | float maxSliderValue(void) const;
|
---|
27 |
|
---|
28 | int extent(void) const;
|
---|
29 |
|
---|
30 | Q_SIGNALS:
|
---|
31 | void sliderMoved(Qt::Orientation, float, float);
|
---|
32 | void valueChanged(Qt::Orientation, float, float);
|
---|
33 |
|
---|
34 | public Q_SLOTS:
|
---|
35 | virtual void setBase(float min, float max);
|
---|
36 | virtual void moveSlider(float min, float max);
|
---|
37 |
|
---|
38 | protected:
|
---|
39 | void sliderRange(int value, float &min, float &max) const;
|
---|
40 | int mapToTick(float) const;
|
---|
41 | float mapFromTick(int) const;
|
---|
42 |
|
---|
43 | private Q_SLOTS:
|
---|
44 | void catchValueChanged(int value);
|
---|
45 | void catchSliderMoved(int value);
|
---|
46 |
|
---|
47 | private:
|
---|
48 | void init(void);
|
---|
49 |
|
---|
50 | bool d_inverted;
|
---|
51 | float d_minBase;
|
---|
52 | float d_maxBase;
|
---|
53 | int d_baseTicks;
|
---|
54 | };
|
---|
55 |
|
---|
56 | #endif
|
---|