[190] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
| 2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/include/qspinbox.h:1 -->
|
---|
| 3 | <html>
|
---|
| 4 | <head>
|
---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
| 6 | <title>qspinbox.h Include File</title>
|
---|
| 7 | <style type="text/css"><!--
|
---|
| 8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
| 9 | a:link { color: #004faf; text-decoration: none }
|
---|
| 10 | a:visited { color: #672967; text-decoration: none }
|
---|
| 11 | body { background: #ffffff; color: black; }
|
---|
| 12 | --></style>
|
---|
| 13 | </head>
|
---|
| 14 | <body>
|
---|
| 15 |
|
---|
| 16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
| 17 | <tr bgcolor="#E5E5E5">
|
---|
| 18 | <td valign=center>
|
---|
| 19 | <a href="index.html">
|
---|
| 20 | <font color="#004faf">Home</font></a>
|
---|
| 21 | | <a href="classes.html">
|
---|
| 22 | <font color="#004faf">All Classes</font></a>
|
---|
| 23 | | <a href="mainclasses.html">
|
---|
| 24 | <font color="#004faf">Main Classes</font></a>
|
---|
| 25 | | <a href="annotated.html">
|
---|
| 26 | <font color="#004faf">Annotated</font></a>
|
---|
| 27 | | <a href="groups.html">
|
---|
| 28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
| 29 | | <a href="functions.html">
|
---|
| 30 | <font color="#004faf">Functions</font></a>
|
---|
| 31 | </td>
|
---|
| 32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>qspinbox.h</h1>
|
---|
| 33 |
|
---|
| 34 | <p>This is the verbatim text of the qspinbox.h include file. It is provided only for illustration; the copyright remains with Trolltech.
|
---|
| 35 | <hr>
|
---|
| 36 | <pre>
|
---|
| 37 | /****************************************************************************
|
---|
| 38 | ** $Id: qspinbox-h.html 2051 2007-02-21 10:04:20Z chehrlic $
|
---|
| 39 | **
|
---|
| 40 | ** Definition of QSpinBox widget class
|
---|
| 41 | **
|
---|
| 42 | ** Created : 970101
|
---|
| 43 | **
|
---|
| 44 | ** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved.
|
---|
| 45 | **
|
---|
| 46 | ** This file is part of the widgets module of the Qt GUI Toolkit.
|
---|
| 47 | **
|
---|
| 48 | ** This file may be distributed under the terms of the Q Public License
|
---|
| 49 | ** as defined by Trolltech ASA of Norway and appearing in the file
|
---|
| 50 | ** LICENSE.QPL included in the packaging of this file.
|
---|
| 51 | **
|
---|
| 52 | ** This file may be distributed and/or modified under the terms of the
|
---|
| 53 | ** GNU General Public License version 2 as published by the Free Software
|
---|
| 54 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
| 55 | ** packaging of this file.
|
---|
| 56 | **
|
---|
| 57 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
|
---|
| 58 | ** licenses may use this file in accordance with the Qt Commercial License
|
---|
| 59 | ** Agreement provided with the Software.
|
---|
| 60 | **
|
---|
| 61 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
---|
| 62 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
---|
| 63 | **
|
---|
| 64 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
|
---|
| 65 | ** information about Qt Commercial License Agreements.
|
---|
| 66 | ** See http://www.trolltech.com/qpl/ for QPL licensing information.
|
---|
| 67 | ** See http://www.trolltech.com/gpl/ for GPL licensing information.
|
---|
| 68 | **
|
---|
| 69 | ** Contact info@trolltech.com if any conditions of this licensing are
|
---|
| 70 | ** not clear to you.
|
---|
| 71 | **
|
---|
| 72 | **********************************************************************/
|
---|
| 73 |
|
---|
| 74 | #ifndef QSPINBOX_H
|
---|
| 75 | #define QSPINBOX_H
|
---|
| 76 |
|
---|
| 77 | #ifndef QT_H
|
---|
| 78 | #include "qwidget.h"
|
---|
| 79 | #include "qrangecontrol.h"
|
---|
| 80 | #endif // QT_H
|
---|
| 81 |
|
---|
| 82 | #ifndef QT_NO_SPINBOX
|
---|
| 83 |
|
---|
| 84 | class QLineEdit;
|
---|
| 85 | class QValidator;
|
---|
| 86 | class QSpinBoxPrivate;
|
---|
| 87 |
|
---|
| 88 | class Q_EXPORT QSpinBox: public QWidget, public QRangeControl
|
---|
| 89 | {
|
---|
| 90 | Q_OBJECT
|
---|
| 91 | Q_ENUMS( ButtonSymbols )
|
---|
| 92 | Q_PROPERTY( QString text READ text )
|
---|
| 93 | Q_PROPERTY( QString prefix READ prefix WRITE setPrefix )
|
---|
| 94 | Q_PROPERTY( QString suffix READ suffix WRITE setSuffix )
|
---|
| 95 | Q_PROPERTY( QString cleanText READ cleanText )
|
---|
| 96 | Q_PROPERTY( QString specialValueText READ specialValueText WRITE setSpecialValueText )
|
---|
| 97 | Q_PROPERTY( bool wrapping READ wrapping WRITE setWrapping )
|
---|
| 98 | Q_PROPERTY( ButtonSymbols buttonSymbols READ buttonSymbols WRITE setButtonSymbols )
|
---|
| 99 | Q_PROPERTY( int maxValue READ maxValue WRITE setMaxValue )
|
---|
| 100 | Q_PROPERTY( int minValue READ minValue WRITE setMinValue )
|
---|
| 101 | Q_PROPERTY( int lineStep READ lineStep WRITE setLineStep )
|
---|
| 102 | Q_PROPERTY( int value READ value WRITE setValue )
|
---|
| 103 |
|
---|
| 104 | public:
|
---|
| 105 | QSpinBox( QWidget* parent=0, const char* name=0 );
|
---|
| 106 | QSpinBox( int minValue, int maxValue, int step = 1,
|
---|
| 107 | QWidget* parent=0, const char* name=0 );
|
---|
| 108 | ~QSpinBox();
|
---|
| 109 |
|
---|
| 110 | QString text() const;
|
---|
| 111 |
|
---|
| 112 | virtual QString prefix() const;
|
---|
| 113 | virtual QString suffix() const;
|
---|
| 114 | virtual QString cleanText() const;
|
---|
| 115 |
|
---|
| 116 | virtual void setSpecialValueText( const QString &text );
|
---|
| 117 | QString specialValueText() const;
|
---|
| 118 |
|
---|
| 119 | virtual void setWrapping( bool on );
|
---|
| 120 | bool wrapping() const;
|
---|
| 121 |
|
---|
| 122 | enum ButtonSymbols { UpDownArrows, PlusMinus };
|
---|
| 123 | virtual void setButtonSymbols( ButtonSymbols );
|
---|
| 124 | ButtonSymbols buttonSymbols() const;
|
---|
| 125 |
|
---|
| 126 | virtual void setValidator( const QValidator* v );
|
---|
| 127 | const QValidator * validator() const;
|
---|
| 128 |
|
---|
| 129 | QSize sizeHint() const;
|
---|
| 130 | QSize minimumSizeHint() const;
|
---|
| 131 |
|
---|
| 132 | int minValue() const;
|
---|
| 133 | int maxValue() const;
|
---|
| 134 | void setMinValue( int );
|
---|
| 135 | void setMaxValue( int );
|
---|
| 136 | int lineStep() const;
|
---|
| 137 | void setLineStep( int );
|
---|
| 138 | int value() const;
|
---|
| 139 |
|
---|
| 140 | QRect upRect() const;
|
---|
| 141 | QRect downRect() const;
|
---|
| 142 |
|
---|
| 143 | public slots:
|
---|
| 144 | virtual void setValue( int value );
|
---|
| 145 | virtual void setPrefix( const QString &text );
|
---|
| 146 | virtual void setSuffix( const QString &text );
|
---|
| 147 | virtual void stepUp();
|
---|
| 148 | virtual void stepDown();
|
---|
| 149 | virtual void setEnabled( bool enabled );
|
---|
| 150 | virtual void selectAll();
|
---|
| 151 |
|
---|
| 152 | signals:
|
---|
| 153 | void valueChanged( int value );
|
---|
| 154 | void valueChanged( const QString &valueText );
|
---|
| 155 |
|
---|
| 156 | protected:
|
---|
| 157 | virtual QString mapValueToText( int value );
|
---|
| 158 | virtual int mapTextToValue( bool* ok );
|
---|
| 159 | QString currentValueText();
|
---|
| 160 |
|
---|
| 161 | virtual void updateDisplay();
|
---|
| 162 | virtual void interpretText();
|
---|
| 163 |
|
---|
| 164 | QLineEdit* editor() const;
|
---|
| 165 |
|
---|
| 166 | virtual void valueChange();
|
---|
| 167 | virtual void rangeChange();
|
---|
| 168 |
|
---|
| 169 | bool eventFilter( QObject* obj, QEvent* ev );
|
---|
| 170 | void resizeEvent( QResizeEvent* ev );
|
---|
| 171 | #ifndef QT_NO_WHEELEVENT
|
---|
| 172 | void wheelEvent( QWheelEvent * );
|
---|
| 173 | #endif
|
---|
| 174 | void leaveEvent( QEvent* );
|
---|
| 175 |
|
---|
| 176 | void styleChange( QStyle& );
|
---|
| 177 |
|
---|
| 178 | protected slots:
|
---|
| 179 | void textChanged();
|
---|
| 180 |
|
---|
| 181 | private:
|
---|
| 182 | void initSpinBox();
|
---|
| 183 | QSpinBoxPrivate* d;
|
---|
| 184 | QLineEdit* vi;
|
---|
| 185 | QValidator* validate;
|
---|
| 186 | QString pfix;
|
---|
| 187 | QString sfix;
|
---|
| 188 | QString specText;
|
---|
| 189 |
|
---|
| 190 | uint wrap : 1;
|
---|
| 191 | uint edited : 1;
|
---|
| 192 |
|
---|
| 193 | void arrangeWidgets();
|
---|
| 194 |
|
---|
| 195 | private: // Disabled copy constructor and operator=
|
---|
| 196 | #if defined(Q_DISABLE_COPY)
|
---|
| 197 | QSpinBox( const QSpinBox& );
|
---|
| 198 | QSpinBox& operator=( const QSpinBox& );
|
---|
| 199 | #endif
|
---|
| 200 |
|
---|
| 201 | };
|
---|
| 202 |
|
---|
| 203 | #endif // QT_NO_SPINBOX
|
---|
| 204 |
|
---|
| 205 | #endif // QSPINBOX_H
|
---|
| 206 | </pre>
|
---|
| 207 | <!-- eof -->
|
---|
| 208 | <p><address><hr><div align=center>
|
---|
| 209 | <table width=100% cellspacing=0 border=0><tr>
|
---|
| 210 | <td>Copyright © 2007
|
---|
| 211 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
| 212 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
| 213 | </table></div></address></body>
|
---|
| 214 | </html>
|
---|