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 QABSTRACTSPINBOX_H
00043 #define QABSTRACTSPINBOX_H
00044
00045 #include <QtGui/qwidget.h>
00046 #include <QtGui/qvalidator.h>
00047
00048 QT_BEGIN_HEADER
00049
00050 QT_BEGIN_NAMESPACE
00051
00052 QT_MODULE(Gui)
00053
00054 #ifndef QT_NO_SPINBOX
00055
00056 class QLineEdit;
00057
00058 class QAbstractSpinBoxPrivate;
00059 class QStyleOptionSpinBox;
00060
00061 class Q_GUI_EXPORT QAbstractSpinBox : public QWidget
00062 {
00063 Q_OBJECT
00064
00065 Q_ENUMS(ButtonSymbols)
00066 Q_ENUMS(CorrectionMode)
00067 Q_PROPERTY(bool wrapping READ wrapping WRITE setWrapping)
00068 Q_PROPERTY(bool frame READ hasFrame WRITE setFrame)
00069 Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment)
00070 Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly)
00071 Q_PROPERTY(ButtonSymbols buttonSymbols READ buttonSymbols WRITE setButtonSymbols)
00072 Q_PROPERTY(QString specialValueText READ specialValueText WRITE setSpecialValueText)
00073 Q_PROPERTY(QString text READ text)
00074 Q_PROPERTY(bool accelerated READ isAccelerated WRITE setAccelerated)
00075 Q_PROPERTY(CorrectionMode correctionMode READ correctionMode WRITE setCorrectionMode)
00076 Q_PROPERTY(bool acceptableInput READ hasAcceptableInput)
00077 Q_PROPERTY(bool keyboardTracking READ keyboardTracking WRITE setKeyboardTracking)
00078 public:
00079 explicit QAbstractSpinBox(QWidget *parent = 0);
00080 ~QAbstractSpinBox();
00081
00082 enum StepEnabledFlag { StepNone = 0x00, StepUpEnabled = 0x01,
00083 StepDownEnabled = 0x02 };
00084 Q_DECLARE_FLAGS(StepEnabled, StepEnabledFlag)
00085
00086 enum ButtonSymbols { UpDownArrows, PlusMinus, NoButtons };
00087
00088 ButtonSymbols buttonSymbols() const;
00089 void setButtonSymbols(ButtonSymbols bs);
00090
00091 enum CorrectionMode { CorrectToPreviousValue, CorrectToNearestValue };
00092
00093 void setCorrectionMode(CorrectionMode cm);
00094 CorrectionMode correctionMode() const;
00095
00096 bool hasAcceptableInput() const;
00097 QString text() const;
00098
00099 QString specialValueText() const;
00100 void setSpecialValueText(const QString &txt);
00101
00102 bool wrapping() const;
00103 void setWrapping(bool w);
00104
00105 void setReadOnly(bool r);
00106 bool isReadOnly() const;
00107
00108 void setKeyboardTracking(bool kt);
00109 bool keyboardTracking() const;
00110
00111 void setAlignment(Qt::Alignment flag);
00112 Qt::Alignment alignment() const;
00113
00114 void setFrame(bool);
00115 bool hasFrame() const;
00116
00117 void setAccelerated(bool on);
00118 bool isAccelerated() const;
00119
00120 QSize sizeHint() const;
00121 QSize minimumSizeHint() const;
00122 void interpretText();
00123 bool event(QEvent *event);
00124
00125 QVariant inputMethodQuery(Qt::InputMethodQuery) const;
00126
00127 virtual QValidator::State validate(QString &input, int &pos) const;
00128 virtual void fixup(QString &input) const;
00129
00130 virtual void stepBy(int steps);
00131 public Q_SLOTS:
00132 void stepUp();
00133 void stepDown();
00134 void selectAll();
00135 virtual void clear();
00136 protected:
00137 void resizeEvent(QResizeEvent *event);
00138 void keyPressEvent(QKeyEvent *event);
00139 void keyReleaseEvent(QKeyEvent *event);
00140 #ifndef QT_NO_WHEELEVENT
00141 void wheelEvent(QWheelEvent *event);
00142 #endif
00143 void focusInEvent(QFocusEvent *event);
00144 void focusOutEvent(QFocusEvent *event);
00145 void contextMenuEvent(QContextMenuEvent *event);
00146 void changeEvent(QEvent *event);
00147 void closeEvent(QCloseEvent *event);
00148 void hideEvent(QHideEvent *event);
00149 void mousePressEvent(QMouseEvent *event);
00150 void mouseReleaseEvent(QMouseEvent *event);
00151 void mouseMoveEvent(QMouseEvent *event);
00152 void timerEvent(QTimerEvent *event);
00153 void paintEvent(QPaintEvent *event);
00154 void showEvent(QShowEvent *event);
00155 void initStyleOption(QStyleOptionSpinBox *option) const;
00156
00157 QLineEdit *lineEdit() const;
00158 void setLineEdit(QLineEdit *edit);
00159
00160 virtual StepEnabled stepEnabled() const;
00161 Q_SIGNALS:
00162 void editingFinished();
00163 protected:
00164 QAbstractSpinBox(QAbstractSpinBoxPrivate &dd, QWidget *parent = 0);
00165
00166 private:
00167 Q_PRIVATE_SLOT(d_func(), void _q_editorTextChanged(const QString &))
00168 Q_PRIVATE_SLOT(d_func(), void _q_editorCursorPositionChanged(int, int))
00169
00170 Q_DECLARE_PRIVATE(QAbstractSpinBox)
00171 Q_DISABLE_COPY(QAbstractSpinBox)
00172 };
00173 Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractSpinBox::StepEnabled)
00174
00175 #endif // QT_NO_SPINBOX
00176
00177 QT_END_NAMESPACE
00178
00179 QT_END_HEADER
00180
00181 #endif // QABSTRACTSPINBOX_H