source: flair-src/trunk/tools/FlairGCS/src/Scrollbar.h@ 9

Last change on this file since 9 was 9, checked in by Sanahuja Guillaume, 7 years ago

gcs

File size: 1.2 KB
Line 
1#ifndef _SCROLLBAR_H
2#define _SCROLLBAR_H 1
3
4#include <qscrollbar.h>
5
6class ScrollBar: public QScrollBar
7{
8 Q_OBJECT
9
10public:
11 ScrollBar(QWidget *parent = NULL);
12 ScrollBar(Qt::Orientation, QWidget *parent = NULL);
13 ScrollBar(float minBase, float maxBase,
14 Qt::Orientation o, QWidget *parent = NULL);
15
16 void setInverted(bool);
17 bool isInverted(void) const;
18
19 float minBaseValue(void) const;
20 float maxBaseValue(void) const;
21
22 float minSliderValue(void) const;
23 float maxSliderValue(void) const;
24
25 int extent(void) const;
26
27Q_SIGNALS:
28 void sliderMoved(Qt::Orientation, float, float);
29 void valueChanged(Qt::Orientation, float, float);
30
31public Q_SLOTS:
32 virtual void setBase(float min, float max);
33 virtual void moveSlider(float min, float max);
34
35protected:
36 void sliderRange(int value, float &min, float &max) const;
37 int mapToTick(float) const;
38 float mapFromTick(int) const;
39
40private Q_SLOTS:
41 void catchValueChanged(int value);
42 void catchSliderMoved(int value);
43
44private:
45 void init(void);
46
47 bool d_inverted;
48 float d_minBase;
49 float d_maxBase;
50 int d_baseTicks;
51};
52
53#endif
Note: See TracBrowser for help on using the repository browser.