scrspinbox.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef SCRSPINBOX
00012 #define SCRSPINBOX
00013
00014 #include <QDoubleSpinBox>
00015 #include <QLineEdit>
00016 #include <QWidget>
00017
00018 #include "scribusapi.h"
00019
00021 class SCRIBUS_API ScrSpinBox : public QDoubleSpinBox
00022 {
00023 Q_OBJECT
00024 public:
00025 ScrSpinBox(QWidget *parent, int unitIndex=0);
00026 ScrSpinBox(double minValue, double maxValue, QWidget *pa, int unitIndex=0);
00027 ~ScrSpinBox();
00028
00029
00030 double valueFromText ( const QString & text ) const;
00031 QString textFromValue ( double value ) const;
00032 QValidator::State validate ( QString & input, int & pos ) const;
00033 void fixup ( QString & input ) const;
00034
00035
00036 void init(int unitIndex);
00037 void setConstants(const QMap<QString, double>* constants);
00038 void setNewUnit(int unitIndex);
00039 double getValue(int unitIndex=0);
00040
00041
00042 void setTabAdvance(bool enable);
00043
00044 public slots:
00045 void setValues(double min, double max, int deci, double val);
00046 void getValues(double *min, double *max, int *deci, double *val);
00047
00048 protected:
00049 void setParameters( int s );
00050 uint m_unitIndex;
00051 bool m_tabAdvance;
00052 const QMap<QString, double>* m_constants;
00053 bool eventFilter ( QObject * watched, QEvent * event );
00054
00055 protected slots:
00056 void textChanged();
00057
00058 };
00059 #endif