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 | {
|
---|
12 | Q_OBJECT
|
---|
13 |
|
---|
14 | public:
|
---|
15 | ScrollBar(QWidget *parent = NULL);
|
---|
16 | ScrollBar(Qt::Orientation, QWidget *parent = NULL);
|
---|
17 | ScrollBar(float minBase, float maxBase,
|
---|
18 | Qt::Orientation o, QWidget *parent = NULL);
|
---|
19 |
|
---|
20 | void setInverted(bool);
|
---|
21 | bool isInverted(void) const;
|
---|
22 |
|
---|
23 | float minBaseValue(void) const;
|
---|
24 | float maxBaseValue(void) const;
|
---|
25 |
|
---|
26 | float minSliderValue(void) const;
|
---|
27 | float maxSliderValue(void) const;
|
---|
28 |
|
---|
29 | int extent(void) const;
|
---|
30 |
|
---|
31 | Q_SIGNALS:
|
---|
32 | void sliderMoved(Qt::Orientation, float, float);
|
---|
33 | void valueChanged(Qt::Orientation, float, float);
|
---|
34 |
|
---|
35 | public Q_SLOTS:
|
---|
36 | virtual void setBase(float min, float max);
|
---|
37 | virtual void moveSlider(float min, float max);
|
---|
38 |
|
---|
39 | protected:
|
---|
40 | void sliderRange(int value, float &min, float &max) const;
|
---|
41 | int mapToTick(float) const;
|
---|
42 | float mapFromTick(int) const;
|
---|
43 |
|
---|
44 | private Q_SLOTS:
|
---|
45 | void catchValueChanged(int value);
|
---|
46 | void catchSliderMoved(int value);
|
---|
47 |
|
---|
48 | private:
|
---|
49 | void init(void);
|
---|
50 |
|
---|
51 | bool d_inverted;
|
---|
52 | float d_minBase;
|
---|
53 | float d_maxBase;
|
---|
54 | int d_baseTicks;
|
---|
55 | };
|
---|
56 |
|
---|
57 | #endif
|
---|