Go to the documentation of this file.00001 #ifndef PLOT_SCROLL_BAR_H
00002 #define PLOT_SCROLL_BAR_H
00003
00004 #include <QScrollBar>
00005
00006 class PlotScrollBar: public QScrollBar
00007 {
00008 Q_OBJECT
00009
00010
00011
00012
00013 public:
00014 PlotScrollBar( QWidget* parent = NULL );
00015 PlotScrollBar( Qt::Orientation, QWidget* parent = NULL );
00016 PlotScrollBar( double minBase, double maxBase, Qt::Orientation o, QWidget* parent = NULL );
00017
00018
00019
00020
00021 signals:
00022 void sliderMoved( Qt::Orientation, double, double );
00023 void valueChanged( Qt::Orientation, double, double );
00024
00025
00026
00027
00028 public slots:
00029 virtual void setBase( double min, double max );
00030 virtual void moveSlider( double min, double max );
00031
00032 private slots:
00033 void catchValueChanged( int value );
00034 void catchSliderMoved( int value );
00035
00036
00037
00038
00039 public:
00040 void setInverted( bool );
00041 bool isInverted() const;
00042 double minBaseValue() const;
00043 double maxBaseValue() const;
00044 double minSliderValue() const;
00045 double maxSliderValue() const;
00046 int extent() const;
00047
00048 protected:
00049 void sliderRange( int value, double &min, double &max ) const;
00050 int mapToTick( double ) const;
00051 double mapFromTick( int ) const;
00052
00053 private:
00054 void init();
00055 void enterEvent( QEvent* event );
00056
00057
00058
00059
00060 private:
00061 bool m_inverted;
00062 double m_minBase;
00063 double m_maxBase;
00064 int m_baseTicks;
00065 };
00066
00067 #endif