Go to the
documentation of this file.
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef QSPINBOX_H
00043 #define QSPINBOX_H
00044
00045 #include <QtGui/qabstractspinbox.h>
00046
00047 QT_BEGIN_HEADER
00048
00049 QT_BEGIN_NAMESPACE
00050
00051 QT_MODULE(Gui)
00052
00053 #ifndef QT_NO_SPINBOX
00054
00055 class QSpinBoxPrivate;
00056 class Q_GUI_EXPORT QSpinBox : public QAbstractSpinBox
00057 {
00058 Q_OBJECT
00059
00060 Q_PROPERTY(QString suffix READ suffix WRITE setSuffix)
00061 Q_PROPERTY(QString prefix READ prefix WRITE setPrefix)
00062 Q_PROPERTY(QString cleanText READ cleanText)
00063 Q_PROPERTY(int minimum READ minimum WRITE setMinimum)
00064 Q_PROPERTY(int maximum READ maximum WRITE setMaximum)
00065 Q_PROPERTY(int singleStep READ singleStep WRITE setSingleStep)
00066 Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged USER true)
00067
00068 public:
00069 explicit QSpinBox(QWidget *parent = 0);
00070 #ifdef QT3_SUPPORT
00071 QT3_SUPPORT_CONSTRUCTOR QSpinBox(QWidget *parent, const char *name);
00072 QT3_SUPPORT_CONSTRUCTOR QSpinBox(int min, int max, int step, QWidget *parent,
00073 const char *name = 0);
00074 #endif
00075
00076 int value() const;
00077
00078 QString prefix() const;
00079 void setPrefix(const QString &prefix);
00080
00081 QString suffix() const;
00082 void setSuffix(const QString &suffix);
00083
00084 QString cleanText() const;
00085
00086 int singleStep() const;
00087 void setSingleStep(int val);
00088
00089 int minimum() const;
00090 void setMinimum(int min);
00091
00092 int maximum() const;
00093 void setMaximum(int max);
00094
00095 void setRange(int min, int max);
00096
00097 #ifdef QT3_SUPPORT
00098 inline QT3_SUPPORT void setLineStep(int step) { setSingleStep(step); }
00099 inline QT3_SUPPORT void setMaxValue(int val) { setMaximum(val); }
00100 inline QT3_SUPPORT void setMinValue(int val) { setMinimum(val); }
00101 inline QT3_SUPPORT int maxValue() const { return maximum(); }
00102 inline QT3_SUPPORT int minValue() const { return minimum(); }
00103 #endif
00104
00105 protected:
00106 bool event(QEvent *event);
00107 virtual QValidator::State validate(QString &input, int &pos) const;
00108 virtual int valueFromText(const QString &text) const;
00109 virtual QString textFromValue(int val) const;
00110 virtual void fixup(QString &str) const;
00111
00112
00113 public Q_SLOTS:
00114 void setValue(int val);
00115
00116 Q_SIGNALS:
00117 void valueChanged(int);
00118 void valueChanged(const QString &);
00119
00120 private:
00121 Q_DISABLE_COPY(QSpinBox)
00122 Q_DECLARE_PRIVATE(QSpinBox)
00123 };
00124
00125 class QDoubleSpinBoxPrivate;
00126 class Q_GUI_EXPORT QDoubleSpinBox : public QAbstractSpinBox
00127 {
00128 Q_OBJECT
00129
00130 Q_PROPERTY(QString prefix READ prefix WRITE setPrefix)
00131 Q_PROPERTY(QString suffix READ suffix WRITE setSuffix)
00132 Q_PROPERTY(QString cleanText READ cleanText)
00133 Q_PROPERTY(int decimals READ decimals WRITE setDecimals)
00134 Q_PROPERTY(double minimum READ minimum WRITE setMinimum)
00135 Q_PROPERTY(double maximum READ maximum WRITE setMaximum)
00136 Q_PROPERTY(double singleStep READ singleStep WRITE setSingleStep)
00137 Q_PROPERTY(double value READ value WRITE setValue NOTIFY valueChanged USER true)
00138 public:
00139 explicit QDoubleSpinBox(QWidget *parent = 0);
00140
00141 double value() const;
00142
00143 QString prefix() const;
00144 void setPrefix(const QString &prefix);
00145
00146 QString suffix() const;
00147 void setSuffix(const QString &suffix);
00148
00149 QString cleanText() const;
00150
00151 double singleStep() const;
00152 void setSingleStep(double val);
00153
00154 double minimum() const;
00155 void setMinimum(double min);
00156
00157 double maximum() const;
00158 void setMaximum(double max);
00159
00160 void setRange(double min, double max);
00161
00162 int decimals() const;
00163 void setDecimals(int prec);
00164
00165 virtual QValidator::State validate(QString &input, int &pos) const;
00166 virtual double valueFromText(const QString &text) const;
00167 virtual QString textFromValue(double val) const;
00168 virtual void fixup(QString &str) const;
00169
00170 public Q_SLOTS:
00171 void setValue(double val);
00172
00173 Q_SIGNALS:
00174 void valueChanged(double);
00175 void valueChanged(const QString &);
00176
00177 private:
00178 Q_DISABLE_COPY(QDoubleSpinBox)
00179 Q_DECLARE_PRIVATE(QDoubleSpinBox)
00180 };
00181
00182 #endif // QT_NO_SPINBOX
00183
00184 QT_END_NAMESPACE
00185
00186 QT_END_HEADER
00187
00188 #endif // QSPINBOX_H