Warning, file /include/QtWidgets/qspinbox.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004 #ifndef QSPINBOX_H
0005 #define QSPINBOX_H
0006
0007 #include <QtWidgets/qtwidgetsglobal.h>
0008 #include <QtWidgets/qabstractspinbox.h>
0009
0010 QT_REQUIRE_CONFIG(spinbox);
0011
0012 QT_BEGIN_NAMESPACE
0013
0014 class QSpinBoxPrivate;
0015 class Q_WIDGETS_EXPORT QSpinBox : public QAbstractSpinBox
0016 {
0017 Q_OBJECT
0018
0019 Q_PROPERTY(QString suffix READ suffix WRITE setSuffix)
0020 Q_PROPERTY(QString prefix READ prefix WRITE setPrefix)
0021 Q_PROPERTY(QString cleanText READ cleanText)
0022 Q_PROPERTY(int minimum READ minimum WRITE setMinimum)
0023 Q_PROPERTY(int maximum READ maximum WRITE setMaximum)
0024 Q_PROPERTY(int singleStep READ singleStep WRITE setSingleStep)
0025 Q_PROPERTY(StepType stepType READ stepType WRITE setStepType)
0026 Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged USER true)
0027 Q_PROPERTY(int displayIntegerBase READ displayIntegerBase WRITE setDisplayIntegerBase)
0028
0029 public:
0030 explicit QSpinBox(QWidget *parent = nullptr);
0031 ~QSpinBox();
0032
0033 int value() const;
0034
0035 QString prefix() const;
0036 void setPrefix(const QString &prefix);
0037
0038 QString suffix() const;
0039 void setSuffix(const QString &suffix);
0040
0041 QString cleanText() const;
0042
0043 int singleStep() const;
0044 void setSingleStep(int val);
0045
0046 int minimum() const;
0047 void setMinimum(int min);
0048
0049 int maximum() const;
0050 void setMaximum(int max);
0051
0052 void setRange(int min, int max);
0053
0054 StepType stepType() const;
0055 void setStepType(StepType stepType);
0056
0057 int displayIntegerBase() const;
0058 void setDisplayIntegerBase(int base);
0059
0060 protected:
0061 bool event(QEvent *event) override;
0062 QValidator::State validate(QString &input, int &pos) const override;
0063 virtual int valueFromText(const QString &text) const;
0064 virtual QString textFromValue(int val) const;
0065 void fixup(QString &str) const override;
0066
0067
0068 public Q_SLOTS:
0069 void setValue(int val);
0070
0071 Q_SIGNALS:
0072 void valueChanged(int);
0073 void textChanged(const QString &);
0074
0075 private:
0076 Q_DISABLE_COPY(QSpinBox)
0077 Q_DECLARE_PRIVATE(QSpinBox)
0078 };
0079
0080 class QDoubleSpinBoxPrivate;
0081 class Q_WIDGETS_EXPORT QDoubleSpinBox : public QAbstractSpinBox
0082 {
0083 Q_OBJECT
0084
0085 Q_PROPERTY(QString prefix READ prefix WRITE setPrefix)
0086 Q_PROPERTY(QString suffix READ suffix WRITE setSuffix)
0087 Q_PROPERTY(QString cleanText READ cleanText)
0088 Q_PROPERTY(int decimals READ decimals WRITE setDecimals)
0089 Q_PROPERTY(double minimum READ minimum WRITE setMinimum)
0090 Q_PROPERTY(double maximum READ maximum WRITE setMaximum)
0091 Q_PROPERTY(double singleStep READ singleStep WRITE setSingleStep)
0092 Q_PROPERTY(StepType stepType READ stepType WRITE setStepType)
0093 Q_PROPERTY(double value READ value WRITE setValue NOTIFY valueChanged USER true)
0094 public:
0095 explicit QDoubleSpinBox(QWidget *parent = nullptr);
0096 ~QDoubleSpinBox();
0097
0098 double value() const;
0099
0100 QString prefix() const;
0101 void setPrefix(const QString &prefix);
0102
0103 QString suffix() const;
0104 void setSuffix(const QString &suffix);
0105
0106 QString cleanText() const;
0107
0108 double singleStep() const;
0109 void setSingleStep(double val);
0110
0111 double minimum() const;
0112 void setMinimum(double min);
0113
0114 double maximum() const;
0115 void setMaximum(double max);
0116
0117 void setRange(double min, double max);
0118
0119 StepType stepType() const;
0120 void setStepType(StepType stepType);
0121
0122 int decimals() const;
0123 void setDecimals(int prec);
0124
0125 QValidator::State validate(QString &input, int &pos) const override;
0126 virtual double valueFromText(const QString &text) const;
0127 virtual QString textFromValue(double val) const;
0128 void fixup(QString &str) const override;
0129
0130 public Q_SLOTS:
0131 void setValue(double val);
0132
0133 Q_SIGNALS:
0134 void valueChanged(double);
0135 void textChanged(const QString &);
0136
0137 private:
0138 Q_DISABLE_COPY(QDoubleSpinBox)
0139 Q_DECLARE_PRIVATE(QDoubleSpinBox)
0140 };
0141
0142 QT_END_NAMESPACE
0143
0144 #endif