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

Last change on this file since 10 was 10, checked in by Sanahuja Guillaume, 6 years ago

lic

File size: 1.3 KB
Line 
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
10class ScrollBar: public QScrollBar
11{
12    Q_OBJECT
13
14public:
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
31Q_SIGNALS:
32    void sliderMoved(Qt::Orientation, float, float);
33    void valueChanged(Qt::Orientation, float, float);
34
35public Q_SLOTS:
36    virtual void setBase(float min, float max);
37    virtual void moveSlider(float min, float max);
38
39protected:
40    void sliderRange(int value, float &min, float &max) const;
41    int mapToTick(float) const;
42    float mapFromTick(int) const;
43
44private Q_SLOTS:
45    void catchValueChanged(int value);
46    void catchSliderMoved(int value);
47
48private:
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
Note: See TracBrowser for help on using the repository browser.