File: qspinbox.html

package info (click to toggle)
qt-embedded 2.3.2-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 68,608 kB
  • ctags: 45,998
  • sloc: cpp: 276,654; ansic: 71,987; makefile: 29,074; sh: 12,305; yacc: 2,465; python: 1,863; perl: 481; lex: 480; xml: 68; lisp: 15
file content (399 lines) | stat: -rw-r--r-- 27,830 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Qt Toolkit - QSpinBox Class</title><style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }body { background: white; color: black; }
--></style>
</head><body bgcolor="#ffffff">

<table width="100%">
<tr><td><a href="index.html">
<img width="100" height="100" src="qtlogo.png"
alt="Home" border="0"><img width="100"
height="100" src="face.png" alt="Home" border="0">
</a><td valign=top><div align=right><img src="dochead.png" width="472" height="27"><br>
<a href="classes.html"><b>Classes</b></a>
-<a href="annotated.html">Annotated</a>
- <a href="hierarchy.html">Tree</a>
-<a href="functions.html">Functions</a>
-<a href="index.html">Home</a>
-<a href="topicals.html"><b>Structure</b></a>
</div>
</table>

<h1 align=center>QSpinBox Class Reference</h1><br clear="all">
<p>
The QSpinBox class provides a spin box widget, sometimes called up-down widget, little arrows widget or spin button.
<a href="#details">More...</a>
<p>
<code>#include &lt;<a href="qspinbox-h.html">qspinbox.h</a>&gt;</code>
<p>
Inherits <a href="qframe.html">QFrame</a> and <a href="qrangecontrol.html">QRangeControl</a>.
<p><a href="qspinbox-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class="fn"><a href="#17d8b5"><b>QSpinBox</b></a>(QWidget*parent=0, constchar*name=0)</div>
<li><div class="fn"><a href="#624318"><b>QSpinBox</b></a>(intminValue, intmaxValue, intstep=1, QWidget*parent=0, constchar*name=0)</div>
<li><div class="fn"><a href="#0e08f6"><b>~QSpinBox</b></a>()</div>
<li><div class="fn">QString<a href="#d34f74"><b>text</b></a>()const</div>
<li><div class="fn">virtualQString<a href="#811601"><b>prefix</b></a>()const</div>
<li><div class="fn">virtualQString<a href="#2ff5f0"><b>suffix</b></a>()const</div>
<li><div class="fn">virtualQString<a href="#a082ff"><b>cleanText</b></a>()const</div>
<li><div class="fn">virtualvoid<a href="#28d1c8"><b>setSpecialValueText</b></a>(constQString&amp;text)</div>
<li><div class="fn">QString<a href="#235658"><b>specialValueText</b></a>()const</div>
<li><div class="fn">virtualvoid<a href="#ca9f8b"><b>setWrapping</b></a>(boolon)</div>
<li><div class="fn">bool<a href="#360408"><b>wrapping</b></a>()const</div>
<li><div class="fn">enum<a href="#ButtonSymbols"><b>ButtonSymbols</b></a>{UpDownArrows, PlusMinus}</div>
<li><div class="fn">void<a href="#4cf4c9"><b>setButtonSymbols</b></a>(ButtonSymbols)</div>
<li><div class="fn">ButtonSymbols<a href="#d41eee"><b>buttonSymbols</b></a>()const</div>
<li><div class="fn">virtualvoid<a href="#73fdb9"><b>setValidator</b></a>(constQValidator*v)</div>
<li><div class="fn">constQValidator*<a href="#4cfa8a"><b>validator</b></a>()const</div>
<li><div class="fn">void<a href="#e59823"><b>setMinValue</b></a>(int)</div>
<li><div class="fn">void<a href="#eae64b"><b>setMaxValue</b></a>(int)</div>
<li><div class="fn">void<a href="#9b004c"><b>setLineStep</b></a>(int)</div>
</ul>
<h2>Public Slots</h2>
<ul>
<li><div class="fn">virtualvoid<a href="#eb409b"><b>setValue</b></a>(intvalue)</div>
<li><div class="fn">virtualvoid<a href="#eccb7d"><b>setPrefix</b></a>(constQString&amp;text)</div>
<li><div class="fn">virtualvoid<a href="#36bd02"><b>setSuffix</b></a>(constQString&amp;text)</div>
<li><div class="fn">virtualvoid<a href="#c8a638"><b>stepUp</b></a>()</div>
<li><div class="fn">virtualvoid<a href="#f0a690"><b>stepDown</b></a>()</div>
</ul>
<h2>Signals</h2>
<ul>
<li><div class="fn">void<a href="#94d714"><b>valueChanged</b></a>(intvalue)</div>
<li><div class="fn">void<a href="#63a61e"><b>valueChanged</b></a>(constQString&amp;valueText)</div>
</ul>
<h2>Protected Members</h2>
<ul>
<li><div class="fn">virtualQString<a href="#5e77bc"><b>mapValueToText</b></a>(intvalue)</div>
<li><div class="fn">virtualint<a href="#bf50c2"><b>mapTextToValue</b></a>(bool*ok)</div>
<li><div class="fn">QString<a href="#b52dfa"><b>currentValueText</b></a>()</div>
<li><div class="fn">virtualvoid<a href="#81118c"><b>updateDisplay</b></a>()</div>
<li><div class="fn">virtualvoid<a href="#c6e0da"><b>interpretText</b></a>()</div>
<li><div class="fn">QPushButton*<a href="#0dd527"><b>upButton</b></a>()const</div>
<li><div class="fn">QPushButton*<a href="#c6328f"><b>downButton</b></a>()const</div>
<li><div class="fn">QLineEdit*<a href="#072542"><b>editor</b></a>()const</div>
<li><div class="fn">virtualvoid<a href="#9f5123"><b>valueChange</b></a>()</div>
<li><div class="fn">virtualvoid<a href="#a6337c"><b>rangeChange</b></a>()</div>
<li><div class="fn">virtualbool<a href="#1b4ed7"><b>eventFilter</b></a>(QObject*obj, QEvent*ev)</div>
</ul>
<h2>Protected Slots</h2>
<ul>
<li><div class="fn">void<a href="#02e381"><b>textChanged</b></a>()</div>
</ul>
<h2>Properties</h2>
<table border=1 cellpadding=3 cellspacing=0>
<tr><th>Type<th>Name<th>READ<th>WRITE<th>Options
<tr><td>QString<td>text<td>text<td>&nbsp;<td>&nbsp;
<tr><td>QString<td>prefix<td>prefix<td>setPrefix<td>&nbsp;
<tr><td>QString<td>suffix<td>suffix<td>setSuffix<td>&nbsp;
<tr><td>QString<td>cleanText<td>cleanText<td>&nbsp;<td>&nbsp;
<tr><td>QString<td>specialValueText<td>specialValueText<td>setSpecialValueText<td>&nbsp;
<tr><td>bool<td>wrapping<td>wrapping<td>setWrapping<td>&nbsp;
<tr><td>ButtonSymbols<td>buttonSymbols<td>buttonSymbols<td>setButtonSymbols<td>&nbsp;
<tr><td>int<td>maxValue<td>maxValue<td>setMaxValue<td>&nbsp;
<tr><td>int<td>minValue<td>minValue<td>setMinValue<td>&nbsp;
<tr><td>int<td>lineStep<td>lineStep<td>setLineStep<td>&nbsp;
<tr><td>int<td>value<td>value<td>setValue<td>&nbsp;
</table>
<hr><h2><a name="details"></a>Detailed Description</h2>
The QSpinBox class provides a spin box widget, sometimes called up-down widget, little arrows widget or spin button.
<p>
QSpinBox allows the user to choose a value, either by
clicking the up/down buttons to increase/decrease the value
currently displayed, or by typing the value directly into the spin
box. Usually the value is an integer.
<p>Every time the value changes, QSpinBox emits the <a href="#63a61e">valueChanged</a>()
signal.  The current value can be fetched with <a href="#385347">value</a>() and set with
<a href="#eb409b">setValue</a>().
<p>The spin box clamps the value within a numeric range, see
<a href="qrangecontrol.html">QRangeControl</a> for details.  Clicking the up/down down buttons (or
using the keyboard accelerators: Up-arrow and Down-arrow) will
increase or decrease the current value in steps of size <a href="#30ee78">lineStep</a>().
<p>Most spin boxes are directional, but QSpinBox can also operate as a
circular spin box, i.e. if the range is 0-99 and the current value
is 99, clicking Up will give 0.  Use <a href="#ca9f8b">setWrapping</a>() if you want
circular behavior.
<p>The displayed value can be prepended and/or appended with an
arbitrary string indicating for example the unit of measurement.
See <a href="#eccb7d">setPrefix</a>() and <a href="#36bd02">setSuffix</a>().
<p>Normally, the spin box displays up and down arrows in the buttons.
You can use <a href="#4cf4c9">setButtonSymbols</a>() to change the display to
show + and - symbols, if this is clearer for your intended purpose.
In either case, the up and down arrow keys always work.
<p>It is often desirable to give the user a special, often default,
choice in addition to the range of numeric values.  See
<a href="#28d1c8">setSpecialValueText</a>() for how to do this with QSpinBox.
<p>The default <a href="qwidget.html#3d478d">QWidget::focusPolicy()</a> is StrongFocus.
<p>QSpinBox can easily be subclassed to allow the user to input other
things than an integer value, as long as the allowed input can be
mapped down to a range of integers.  This can be done by overriding
the virtual functions <a href="#5e77bc">mapValueToText</a>() and <a href="#bf50c2">mapTextToValue</a>() and
setting another, suitable validator using <a href="#73fdb9">setValidator</a>(). For example,
these function could be changed so that the user provided values
from 0.0 to 10.0 while the range of integers used inside the program
would be 0 to 100:
<p><pre>  class MySpinBox : public QSpinBox {
  public:
    ...

    <a href="qstring.html">QString</a>     mapValueToText( int value )
    {
      return QString("%1.%2").arg(value/10).arg(value%10);
    }

    int         mapTextToValue( bool* ok )
    {
      return int(text().toFloat()*10);
    }

  };
</pre>
<p><img src=qspinbox-m.png> <img src=qspinbox-w.png>
<p>See also  <a href="qscrollbar.html">QScrollBar</a>, <a href="qslider.html">QSlider</a> and <a href="guibooks.html#fowler">GUI Design Handbook: Spin Box</a>

<hr><h2>Member Type Documentation</h2>
<h3 class="fn"><a name="ButtonSymbols">QSpinBox::ButtonSymbols</a></h3>
This enum type determines what the buttons in a spin box show.  The
currently defined values are: <ul>
<li> <code>UpDownArrows</code> - the buttons show little arrows, in the
classic style.  This is the default.
<li> <code>PlusMinus</code> - the buttons show '+' and '-' symbols.  This is
often considered to be more meaningful than <code>UpDownArrows.</code>
<p></ul>
<hr><h2>Member Function Documentation</h2>
<h3 class="fn"><a name="17d8b5"></a>QSpinBox::QSpinBox(<a href="qwidget.html">QWidget</a>*parent=0, constchar*name=0)</h3>
<p>Constructs a spin box with the default <a href="qrangecontrol.html">QRangeControl</a> range and step
values.
<p>See also  <a href="#1c0af0">minValue</a>(), <a href="#1d267e">maxValue</a>(), <a href="qrangecontrol.html#f2409c">setRange</a>(), <a href="#30ee78">lineStep</a>() and <a href="qrangecontrol.html#1b6f6d">setSteps</a>().
<h3 class="fn"><a name="624318"></a>QSpinBox::QSpinBox(intminValue, intmaxValue, intstep=1, <a href="qwidget.html">QWidget</a>*parent=0, constchar*name=0)</h3>
<p>Constructs a spin box with range from <em>minValue</em> to <em>maxValue</em>
inclusive, with step amount <em>step.</em>  The value is initially
set to <em>minValue.</em>
<p>See also  <a href="#1c0af0">minValue</a>(), <a href="#1d267e">maxValue</a>(), <a href="qrangecontrol.html#f2409c">setRange</a>(), <a href="#30ee78">lineStep</a>() and <a href="qrangecontrol.html#1b6f6d">setSteps</a>().
<h3 class="fn"><a name="0e08f6"></a>QSpinBox::~QSpinBox()</h3>
<p>Destroys the spin box, freeing all memory and other resources.
<h3 class="fn">QSpinBox::ButtonSymbols<a name="d41eee"></a>QSpinBox::buttonSymbols()const</h3>
<p>Returns the current button symbol mode.  The default is <code>UpDownArrows.</code>
<p>See also  <a href="#4cf4c9">setButtonSymbols</a>() and <a href="#ButtonSymbols">ButtonSymbols</a>.
<h3 class="fn"><a href="qstring.html">QString</a><a name="a082ff"></a>QSpinBox::cleanText()const <code>[virtual]</code></h3>
<p>Returns a copy of the current text of the spin box with any prefix
and/or suffix and white space at the start and end removed.
<p>See also  <a href="#d34f74">text</a>(), <a href="#eccb7d">setPrefix</a>() and <a href="#36bd02">setSuffix</a>().
<h3 class="fn"><a href="qstring.html">QString</a><a name="b52dfa"></a>QSpinBox::currentValueText() <code>[protected]</code></h3>
<p>Returns the full text calculated from the current value, including any
prefix, suffix or special-value text.
<h3 class="fn"><a href="qpushbutton.html">QPushButton</a>*<a name="c6328f"></a>QSpinBox::downButton()const <code>[protected]</code></h3>
<p>Returns a pointer to the embedded 'down' button.
<h3 class="fn"><a href="qlineedit.html">QLineEdit</a>*<a name="072542"></a>QSpinBox::editor()const <code>[protected]</code></h3>
<p>Returns a pointer to the embedded <a href="qlineedit.html">QLineEdit</a>.
<h3 class="fn">bool<a name="1b4ed7"></a>QSpinBox::eventFilter(<a href="qobject.html">QObject</a>*obj, <a href="qevent.html">QEvent</a>*ev) <code>[virtualprotected]</code></h3>
<p>Intercepts and handles those events coming to the embedded <a href="qlineedit.html">QLineEdit</a>
which have special meaning for the QSpinBox.
<p>Reimplemented from <a href="qobject.html#bd20fe">QObject.</a>
<h3 class="fn">void<a name="c6e0da"></a>QSpinBox::interpretText() <code>[virtualprotected]</code></h3>
<p>QSpinBox calls this after the user has manually edited the contents
of the spin box (not using the up/down buttons/keys).
<p>The default implementation of this function interprets the new text
using <a href="#bf50c2">mapTextToValue</a>().  If mapTextToValue() is successful, it
changes the spin box' value.  If not the value if left unchanged.
<h3 class="fn">void<a name="74af0b"></a>QSpinBox::leaveEvent(<a href="qevent.html">QEvent</a>*) <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#7eaa8a">QWidget.</a>
<h3 class="fn">int<a name="30ee78"></a>QSpinBox::lineStep()const</h3>
<p>Reimplemented for internal reasons; the API is not affected.
<h3 class="fn">int<a name="bf50c2"></a>QSpinBox::mapTextToValue(bool*ok) <code>[virtualprotected]</code></h3>
<p>This virtual function is used by the spin box whenever it needs to
interpret the text entered by the user as a value.  The default
implementation tries to interpret it as an integer in the standard
way, and returns the integer value.
<p>Reimplement this function in in a subclass if you want a specialized
spin box, handling something else than integers.  It should call
<a href="#d34f74">text</a>() (or <a href="#a082ff">cleanText</a>() ) and return the value corresponding to that
text.  If the text does not represent a legal value
(uninterpretable), the bool pointed to by <em>ok</em> should be set to
FALSE.
<p>This function need not be concerned with <a href="#28d1c8">special-value text,</a> the QSpinBox handles that
automatically.
<p>See also  <a href="#c6e0da">interpretText</a>() and <a href="#5e77bc">mapValueToText</a>().
<h3 class="fn"><a href="qstring.html">QString</a><a name="5e77bc"></a>QSpinBox::mapValueToText(intv) <code>[virtualprotected]</code></h3>
<p>This virtual function is used by the spin box whenever it needs to
display value <em>v.</em>  The default implementation returns a string
containing <em>v</em> printed in the standard way.
<p>Reimplement this function in in a subclass if you want a specialized
spin box, handling something else than integers.  This function need
not be concerned with <a href="#eccb7d">prefix</a> or <a href="#36bd02">suffix</a> or <a href="#28d1c8">special-value text,</a> the QSpinBox handles that
automatically.
<p>See also  <a href="#81118c">updateDisplay</a>() and <a href="#bf50c2">mapTextToValue</a>().
<h3 class="fn">int<a name="1d267e"></a>QSpinBox::maxValue()const</h3>
<p>Reimplemented for internal reasons; the API is not affected.
<h3 class="fn">int<a name="1c0af0"></a>QSpinBox::minValue()const</h3>
<p>Reimplemented for internal reasons; the API is not affected.
<h3 class="fn"><a href="qstring.html">QString</a><a name="811601"></a>QSpinBox::prefix()const <code>[virtual]</code></h3>
<p>Returns the currently set prefix, or a null string if no prefix is
set.
<p>See also  <a href="#eccb7d">setPrefix</a>(), <a href="#36bd02">setSuffix</a>() and <a href="#2ff5f0">suffix</a>().
<h3 class="fn">void<a name="a6337c"></a>QSpinBox::rangeChange() <code>[virtualprotected]</code></h3>
<p>This method gets called by <a href="qrangecontrol.html">QRangeControl</a> whenever the range has
changed.  It adjusts the default validator and updates the display.
<h3 class="fn">void<a name="c6bce4"></a>QSpinBox::resizeEvent(<a href="qresizeevent.html">QResizeEvent</a>*) <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#7d375f">QWidget.</a>
<h3 class="fn">void<a name="4cf4c9"></a>QSpinBox::setButtonSymbols(<a href="qspinbox.html#ButtonSymbols">ButtonSymbols</a>newSymbols)</h3>
<p>Sets the spin box to display <em>newSymbols</em> on its buttons.  <em>newSymbols</em> can be either <code>UpDownArrows</code> (the default) or <code>PlusMinus.</code>
<p>See also  <a href="#d41eee">buttonSymbols</a>() and <a href="#ButtonSymbols">ButtonSymbols</a>.
<h3 class="fn">void<a name="df037f"></a>QSpinBox::setEnabled(boolon) <code>[virtualslot]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<h3 class="fn">void<a name="9b004c"></a>QSpinBox::setLineStep(inti)</h3>
<p>Sets the line step to <em>i.</em>
<p>Calls the virtual <a href="qrangecontrol.html#e0aaf5">stepChange</a>() function if the new line step is
different from the previous setting.
<p>See also  <a href="#30ee78">lineStep</a>(), <a href="qrangecontrol.html#1b6f6d">QRangeControl::setSteps</a>() and <a href="qrangecontrol.html#f2409c">setRange</a>().
<h3 class="fn">void<a name="eae64b"></a>QSpinBox::setMaxValue(inti)</h3>
<p>A convenience function which just calls
<a href="qrangecontrol.html#f2409c">setRange</a>( <a href="#1c0af0">minValue</a>(), i )
<p>See also  <a href="qrangecontrol.html#f2409c">setRange</a>().
<h3 class="fn">void<a name="e59823"></a>QSpinBox::setMinValue(inti)</h3>
<p>A convenience function which just calls
<a href="qrangecontrol.html#f2409c">setRange</a>( i, <a href="#1d267e">maxValue</a>() )
<p>See also  <a href="qrangecontrol.html#f2409c">setRange</a>().
<h3 class="fn">void<a name="eccb7d"></a>QSpinBox::setPrefix(const<a href="qstring.html">QString</a>&amp;text) <code>[virtualslot]</code></h3>
<p>Sets the prefix to <em>text.</em>  The prefix is prepended to the start of
the displayed value.  Typical use is to indicate the unit of
measurement to the user. eg.
<p><pre>    sb-&gt;setPrefix("$");
</pre>
<p>To turn off the prefix display, call this function with an empty
string as parameter.  The default is no prefix.
<p>See also  <a href="#811601">prefix</a>(), <a href="#36bd02">setSuffix</a>() and <a href="#2ff5f0">suffix</a>().
<h3 class="fn">void<a name="28d1c8"></a>QSpinBox::setSpecialValueText(const<a href="qstring.html">QString</a>&amp;text) <code>[virtual]</code></h3>
<p>Sets the special-value text to <em>text.</em>  If set, the spin box will
display this text instead of a numeric value whenever the current
value is equal to minVal().  Typically used for indicating that this
choice has a special (default) meaning.
<p>For example, if your spin box allows the user to choose the
margin width in a print dialog, and your application is able to
automatically choose a good margin width, you can set up the spin
box like this:
<pre>    <a href="qspinbox.html">QSpinBox</a> marginBox( -1, 20, 1, parent, "marginBox" );
    marginBox-&gt;<a href="#36bd02">setSuffix</a>( " mm" );
    marginBox-&gt;<a href="#28d1c8">setSpecialValueText</a>( "Auto" );
</pre>
<p>The user will then be able to choose a margin width from 0-20
millimeters, or select "Auto" to leave it to the application to
choose.  Your code must then interpret the spin box value of -1 as
the user requesting automatic margin width.
<p>Neither <a href="#eccb7d">prefix</a> nor <a href="#36bd02">suffix,</a> if set, are added to the special-value text when
displayed.
<p>To turn off the special-value text display, call this function with
an empty string as parameter. The default is no special-value text,
i.e. the numeric value is shown as usual.
<p>See also  <a href="#235658">specialValueText</a>().
<h3 class="fn">void<a name="36bd02"></a>QSpinBox::setSuffix(const<a href="qstring.html">QString</a>&amp;text) <code>[virtualslot]</code></h3>
<p>Sets the suffix to <em>text.</em>  The suffix is appended to the end of the
displayed value.  Typical use is to indicate the unit of measurement
to the user. eg.
<p><pre>    sb-&gt;setSuffix("cm");
</pre>
<p>To turn off the suffix display, call this function with an empty
string as parameter.  The default is no suffix.
<p>See also  <a href="#2ff5f0">suffix</a>(), <a href="#eccb7d">setPrefix</a>() and <a href="#811601">prefix</a>().
<h3 class="fn">void<a name="73fdb9"></a>QSpinBox::setValidator(const<a href="qvalidator.html">QValidator</a>*v) <code>[virtual]</code></h3>
<p>Sets the validator to <em>v.</em>  The validator controls what keyboard
input is accepted when the user is editing in the value field.  The
default is to use a suitable <a href="qintvalidator.html">QIntValidator</a>.
<p>Use setValidator(0) to turn off input validation (entered input will
still be clamped to the range of the spinbox).
<h3 class="fn">void<a name="eb409b"></a>QSpinBox::setValue(intvalue) <code>[virtualslot]</code></h3>
<p>Sets the current value of the spin box to <em>value.</em>  This is
<a href="qrangecontrol.html#bc1c05">QRangeControl::setValue</a>() made available as a slot.
<h3 class="fn">void<a name="ca9f8b"></a>QSpinBox::setWrapping(boolon) <code>[virtual]</code></h3>
<p>Setting wrapping to TRUE will allow the value to be stepped from the
highest value to the lowest, and vice versa.  By default, wrapping is
turned off.
<p>See also  <a href="#360408">wrapping</a>(), <a href="#1c0af0">minValue</a>(), <a href="#1d267e">maxValue</a>() and <a href="qrangecontrol.html#f2409c">setRange</a>().
<h3 class="fn"><a href="qsize.html">QSize</a><a name="ffd3ee"></a>QSpinBox::sizeHint()const <code>[virtual]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#4511d1">QWidget.</a>
<h3 class="fn"><a href="qsizepolicy.html">QSizePolicy</a><a name="3dd6ad"></a>QSpinBox::sizePolicy()const <code>[virtual]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#23726d">QWidget.</a>
<h3 class="fn"><a href="qstring.html">QString</a><a name="235658"></a>QSpinBox::specialValueText()const</h3>
<p>Returns the currently special-value text, or a null string if no
special-value text is currently set.
<p>See also  <a href="#28d1c8">setSpecialValueText</a>().
<h3 class="fn">void<a name="f0a690"></a>QSpinBox::stepDown() <code>[virtualslot]</code></h3>
<p>Decreases the current value one step, wrapping as necessary.  This is
the same as clicking on the pointing-down button, and can be used
for e.g.  keyboard accelerators.
<p>See also  <a href="#c8a638">stepUp</a>(), <a href="qrangecontrol.html#caed18">subtractLine</a>(), <a href="#30ee78">lineStep</a>(), <a href="qrangecontrol.html#1b6f6d">setSteps</a>(), <a href="#eb409b">setValue</a>() and <a href="#385347">value</a>().
<h3 class="fn">void<a name="c8a638"></a>QSpinBox::stepUp() <code>[virtualslot]</code></h3>
<p>Increases the current value one step, wrapping as necessary.  This is
the same as clicking on the pointing-up button, and can be used for
e.g.  keyboard accelerators.
<p>See also  <a href="#f0a690">stepDown</a>(), <a href="qrangecontrol.html#0767c3">addLine</a>(), <a href="#30ee78">lineStep</a>(), <a href="qrangecontrol.html#1b6f6d">setSteps</a>(), <a href="#eb409b">setValue</a>() and <a href="#385347">value</a>().
<h3 class="fn">void<a name="09dd94"></a>QSpinBox::styleChange(<a href="qstyle.html">QStyle</a>&amp;old) <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#5e2e23">QWidget.</a>
<h3 class="fn"><a href="qstring.html">QString</a><a name="2ff5f0"></a>QSpinBox::suffix()const <code>[virtual]</code></h3>
<p>Returns the currently set suffix, or a null string if no suffix is
set.
<p>See also  <a href="#36bd02">setSuffix</a>(), <a href="#eccb7d">setPrefix</a>() and suffix().
<h3 class="fn"><a href="qstring.html">QString</a><a name="d34f74"></a>QSpinBox::text()const</h3>
<p>Returns the current text of the spin box, including any <a href="#811601">prefix</a>() and <a href="#2ff5f0">suffix</a>().
<p>See also  <a href="#385347">value</a>().
<h3 class="fn">void<a name="02e381"></a>QSpinBox::textChanged() <code>[protectedslot]</code></h3>
<p>This slot gets called whenever the user edits the text of the spin box.
<h3 class="fn"><a href="qpushbutton.html">QPushButton</a>*<a name="0dd527"></a>QSpinBox::upButton()const <code>[protected]</code></h3>
<p>Returns a pointer to the embedded 'up' button.
<h3 class="fn">void<a name="81118c"></a>QSpinBox::updateDisplay() <code>[virtualprotected]</code></h3>
<p>Updates the contents of the embedded <a href="qlineedit.html">QLineEdit</a> to reflect current
value, using <a href="#5e77bc">mapValueToText</a>().  Also enables/disables the push
buttons accordingly.
<p>See also  <a href="#5e77bc">mapValueToText</a>().
<h3 class="fn">const<a href="qvalidator.html">QValidator</a>*<a name="4cfa8a"></a>QSpinBox::validator()const</h3>
<p>Returns the validator which constrains editing for this spin box if
there is any, or else 0.
<p>See also  <a href="#73fdb9">setValidator</a>() and <a href="qvalidator.html">QValidator</a>.
<h3 class="fn">int<a name="385347"></a>QSpinBox::value()const</h3>
<p>Reimplemented for internal reasons; the API is not affected.
<h3 class="fn">void<a name="9f5123"></a>QSpinBox::valueChange() <code>[virtualprotected]</code></h3>
<p>This method gets called by <a href="qrangecontrol.html">QRangeControl</a> whenever the value has changed.
Updates the display and emits the <a href="#63a61e">valueChanged</a>() signals.
<h3 class="fn">void<a name="63a61e"></a>QSpinBox::valueChanged(const<a href="qstring.html">QString</a>&amp;valueText) <code>[signal]</code></h3>
<p>This signal is emitted whenever the valueChanged( int ) signal is
emitted, i.e.  every time the value of the spin box changes (whatever
the cause - by <a href="#eb409b">setValue</a>(), by a keyboard accelerator, by mouse
clicks etc.).
<p>The <em>valueText</em> parameter is the same string that is
displayed in the edit field of the spin box.
<p>See also  <a href="#385347">value</a>().
<h3 class="fn">void<a name="94d714"></a>QSpinBox::valueChanged(intvalue) <code>[signal]</code></h3>
<p>This signal is emitted every time the value of the spin box changes
(whatever the cause - by <a href="#eb409b">setValue</a>(), by a keyboard accelerator, by
mouse clicks etc.).
<p>Note that it is emitted <em>every</em> time, not just for the "final" step
- if the user clicks 'up' three times, this signal is emitted three
times.
<p>See also  <a href="#385347">value</a>().
<h3 class="fn">void<a name="1c7d68"></a>QSpinBox::wheelEvent(<a href="qwheelevent.html">QWheelEvent</a>*e) <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#6f6c80">QWidget.</a>
<h3 class="fn">bool<a name="360408"></a>QSpinBox::wrapping()const</h3>
<p>Returns the current <a href="#ca9f8b">setWrapping</a>() value.
<hr><p>
Search the documentation, FAQ, qt-interest archive and more (uses
<a href="http://www.trolltech.com">www.trolltech.com</a>):<br>
<form method=post action="http://www.trolltech.com/search.cgi">
<input type=hidden name="version" value="2.3.2"><nobr>
<input size="50" name="search"><input type=submit value="Search">
</nobr></form><hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>,
copyright &copy; 1995-2001
<a href="http://www.trolltech.com">Trolltech</a>, all rights reserved.<p><address><hr><div align="center">
<table width="100%" cellspacing="0" border="0"><tr>
<td>Copyright  2001 Trolltech<td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align="right"><div align="right">Qt version 2.3.2</div>
</table></div></address></body></html>