1
/****************************************************************************
3
** Copyright (C) 1992-2005 Trolltech AS. All rights reserved.
5
** This file is part of the widgets module of the Qt Toolkit.
7
** This file may be distributed under the terms of the Q Public License
8
** as defined by Trolltech AS of Norway and appearing in the file
9
** LICENSE.QPL included in the packaging of this file.
11
** This file may be distributed and/or modified under the terms of the
12
** GNU General Public License version 2 as published by the Free Software
13
** Foundation and appearing in the file LICENSE.GPL included in the
14
** packaging of this file.
16
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
17
** information about Qt Commercial License Agreements.
18
** See http://www.trolltech.com/qpl/ for QPL licensing information.
19
** See http://www.trolltech.com/gpl/ for GPL licensing information.
21
** Contact info@trolltech.com if any conditions of this licensing are
24
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
25
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27
****************************************************************************/
29
#ifndef QABSTRACTSPINBOX_H
30
#define QABSTRACTSPINBOX_H
32
#include <QtGui/qwidget.h>
33
#include <QtGui/qvalidator.h>
37
class QAbstractSpinBoxPrivate;
38
class Q_GUI_EXPORT QAbstractSpinBox : public QWidget
42
Q_ENUMS(ButtonSymbols)
43
Q_PROPERTY(bool wrapping READ wrapping WRITE setWrapping)
44
Q_PROPERTY(bool frame READ hasFrame WRITE setFrame)
45
Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment)
46
Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly)
47
Q_PROPERTY(ButtonSymbols buttonSymbols READ buttonSymbols WRITE setButtonSymbols)
48
Q_PROPERTY(QString specialValueText READ specialValueText WRITE setSpecialValueText)
49
Q_PROPERTY(QString text READ text)
52
explicit QAbstractSpinBox(QWidget *parent = 0);
55
enum StepEnabledFlag { StepNone = 0x00, StepUpEnabled = 0x01,
56
StepDownEnabled = 0x02 };
57
Q_DECLARE_FLAGS(StepEnabled, StepEnabledFlag)
59
enum ButtonSymbols { UpDownArrows, PlusMinus };
61
ButtonSymbols buttonSymbols() const;
62
void setButtonSymbols(ButtonSymbols bs);
66
QString specialValueText() const;
67
void setSpecialValueText(const QString &s);
69
bool wrapping() const;
70
void setWrapping(bool w);
72
void setReadOnly(bool r);
73
bool isReadOnly() const;
75
void setAlignment(Qt::Alignment flag);
76
Qt::Alignment alignment() const;
79
bool hasFrame() const;
81
QSize sizeHint() const;
82
QSize minimumSizeHint() const;
85
bool event(QEvent *event);
87
virtual QValidator::State validate(QString &input, int &pos) const;
88
virtual void fixup(QString &input) const;
90
virtual void stepBy(int steps);
98
void resizeEvent(QResizeEvent *e);
99
void keyPressEvent(QKeyEvent *e);
100
void keyReleaseEvent(QKeyEvent *e);
101
void wheelEvent(QWheelEvent *e);
102
void focusInEvent(QFocusEvent *e);
103
void focusOutEvent(QFocusEvent *e);
104
void contextMenuEvent(QContextMenuEvent *e);
105
void changeEvent(QEvent *e);
106
void closeEvent(QCloseEvent *e);
107
void hideEvent(QHideEvent *e);
108
void mousePressEvent(QMouseEvent *e);
109
void mouseReleaseEvent(QMouseEvent *e);
110
void mouseMoveEvent(QMouseEvent *e);
111
void timerEvent(QTimerEvent *e);
112
void paintEvent(QPaintEvent *e);
113
void showEvent(QShowEvent *e);
115
QLineEdit *lineEdit() const;
116
void setLineEdit(QLineEdit *e);
118
virtual StepEnabled stepEnabled() const;
120
void editingFinished();
122
QAbstractSpinBox(QAbstractSpinBoxPrivate &dd, QWidget *parent = 0);
125
Q_PRIVATE_SLOT(d_func(), void editorTextChanged(const QString &))
126
Q_PRIVATE_SLOT(d_func(), void editorCursorPositionChanged(int, int))
128
Q_DECLARE_PRIVATE(QAbstractSpinBox)
129
Q_DISABLE_COPY(QAbstractSpinBox)
131
Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractSpinBox::StepEnabled)
132
#endif // QABSTRACTSPINBOX_H