universalslider.h

Go to the documentation of this file.
00001 //=============================================================================
00016 #ifndef __UNIVERSALSLIDER_H_INCLUDED__
00017 #define __UNIVERSALSLIDER_H_INCLUDED__
00018 
00019 #include <QtGui/QWidget>
00020 #include <QtGui/QDoubleSpinBox>
00021 #include <QtGui/QSlider>
00022 
00023 
00024 //=============================================================================
00025 //  CUniversalSlider
00026 //=============================================================================
00027 
00040 class CUniversalSlider : public QWidget
00041 {
00042     Q_OBJECT
00043 public:
00047     CUniversalSlider( const QString & componentName = QString() );
00048 
00053     void setContentBool ( bool value );
00054 
00060     void setContentInt  ( int minimum, int maximum, int value );
00061 
00067     void setContentFloat( double minimum, double maximum, double value );
00068 
00075     bool getContentBool( void );
00076 
00080     int getContentInt( void );
00081 
00085     double getContentFloat( void );
00086 
00087 signals:
00096     void contentsChanged( void );
00097 
00098 private slots:
00099     void updateValue( double value );
00100     void updateRange( double minimum, double maximum );
00101     void updateMinimum( double value );
00102     void updateMaximum( double value );
00103     void retranslateSliderValue( int value );
00104 
00105 private:
00106 
00107     // construction helper
00108     void createWidgets( const QString & name );
00109 
00110     // state changes
00111     void setFloatMode( bool enable );
00112     void setRangeFixed( bool fixed );
00113     void setDataRange( double minimum, double maximum );
00114     void setSlider( double minimum, double maximum, double value );
00115 
00116     // internal signal processing filters
00117     // -> if zero, the signal can be processed.
00118     // -> used with ++ and -- for recursions
00119     int m_skipUpdateRange;
00120     int m_skipUpdateValue;
00121     int m_skipUpdateSlider; // setSlider called by retranslateSlider
00122 
00123     // widgets
00124     QDoubleSpinBox* m_value;
00125     QDoubleSpinBox* m_minimum;
00126     QDoubleSpinBox* m_maximum;
00127     QSlider*        m_slider;
00128 
00129     // range of m_slider
00130     int m_sliderRange;
00131 };
00132 
00133 
00134 #endif  // __UNIVERSALSLIDER_H_INCLUDED__

Generated on Sun Mar 2 17:12:31 2008 for Shader Maker by  doxygen 1.5.4