Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > 8e6051afcdb111a0317a58fb64c2abf5 > files > 4870

qt4-doc-4.6.3-0.2mdv2010.2.i586.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- qspinbox.cpp -->
<head>
  <title>Qt 4.6: QSpinBox Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a name="//apple_ref/cpp/cl//QSpinBox"></a>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">QSpinBox Class Reference<br /><span class="small-subtitle">[<a href="qtgui.html">QtGui</a> module]</span>
</h1>
<p>The QSpinBox class provides a spin box widget. <a href="#details">More...</a></p>
<pre> #include &lt;QSpinBox&gt;</pre><p>Inherits <a href="qabstractspinbox.html">QAbstractSpinBox</a>.</p>
<ul>
<li><a href="qspinbox-members.html">List of all members, including inherited members</a></li>
<li><a href="qspinbox-qt3.html">Qt 3 support members</a></li>
</ul>
<hr />
<a name="properties"></a>
<h2>Properties</h2>
<p><table class="propsummary" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td width="45%" valign="top"><ul>
<li><div class="fn"><b><a href="qspinbox.html#cleanText-prop">cleanText</a></b> : const QString</div></li>
<li><div class="fn"><b><a href="qspinbox.html#maximum-prop">maximum</a></b> : int</div></li>
<li><div class="fn"><b><a href="qspinbox.html#minimum-prop">minimum</a></b> : int</div></li>
<li><div class="fn"><b><a href="qspinbox.html#prefix-prop">prefix</a></b> : QString</div></li>
</ul></td><td valign="top"><ul>
<li><div class="fn"><b><a href="qspinbox.html#singleStep-prop">singleStep</a></b> : int</div></li>
<li><div class="fn"><b><a href="qspinbox.html#suffix-prop">suffix</a></b> : QString</div></li>
<li><div class="fn"><b><a href="qspinbox.html#value-prop">value</a></b> : int</div></li>
</ul>
</td></tr>
</table></p>
<ul>
<li><div bar="2" class="fn"></div>11 properties inherited from <a href="qabstractspinbox.html#properties">QAbstractSpinBox</a></li>
<li><div bar="2" class="fn"></div>58 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li><div bar="2" class="fn"></div>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<hr />
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qspinbox.html#QSpinBox">QSpinBox</a></b> ( QWidget * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="qspinbox.html#cleanText-prop">cleanText</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="qspinbox.html#maximum-prop">maximum</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="qspinbox.html#minimum-prop">minimum</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="qspinbox.html#prefix-prop">prefix</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qspinbox.html#maximum-prop">setMaximum</a></b> ( int <i>max</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qspinbox.html#minimum-prop">setMinimum</a></b> ( int <i>min</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qspinbox.html#prefix-prop">setPrefix</a></b> ( const QString &amp; <i>prefix</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qspinbox.html#setRange">setRange</a></b> ( int <i>minimum</i>, int <i>maximum</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qspinbox.html#singleStep-prop">setSingleStep</a></b> ( int <i>val</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qspinbox.html#suffix-prop">setSuffix</a></b> ( const QString &amp; <i>suffix</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="qspinbox.html#singleStep-prop">singleStep</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="qspinbox.html#suffix-prop">suffix</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="qspinbox.html#value-prop">value</a></b> () const</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>28 public functions inherited from <a href="qabstractspinbox.html#public-functions">QAbstractSpinBox</a></li>
<li><div bar="2" class="fn"></div>217 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li><div bar="2" class="fn"></div>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li><div bar="2" class="fn"></div>13 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<hr />
<a name="public-slots"></a>
<h2>Public Slots</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qspinbox.html#value-prop">setValue</a></b> ( int <i>val</i> )</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>4 public slots inherited from <a href="qabstractspinbox.html#public-slots">QAbstractSpinBox</a></li>
<li><div bar="2" class="fn"></div>19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li><div bar="2" class="fn"></div>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
</ul>
<hr />
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qspinbox.html#valueChanged">valueChanged</a></b> ( int <i>i</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qspinbox.html#valueChanged-2">valueChanged</a></b> ( const QString &amp; <i>text</i> )</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>1 signal inherited from <a href="qabstractspinbox.html#signals">QAbstractSpinBox</a></li>
<li><div bar="2" class="fn"></div>1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li><div bar="2" class="fn"></div>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<hr />
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual QString </td><td class="memItemRight" valign="bottom"><b><a href="qspinbox.html#textFromValue">textFromValue</a></b> ( int <i>value</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><b><a href="qspinbox.html#valueFromText">valueFromText</a></b> ( const QString &amp; <i>text</i> ) const</td></tr>
</table>
<hr />
<a name="reimplemented-protected-functions"></a>
<h2>Reimplemented Protected Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><b><a href="qspinbox.html#event">event</a></b> ( QEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qspinbox.html#fixup">fixup</a></b> ( QString &amp; <i>input</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual QValidator::State </td><td class="memItemRight" valign="bottom"><b><a href="qspinbox.html#validate">validate</a></b> ( QString &amp; <i>text</i>, int &amp; <i>pos</i> ) const</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>20 protected functions inherited from <a href="qabstractspinbox.html#protected-functions">QAbstractSpinBox</a></li>
<li><div bar="2" class="fn"></div>37 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li><div bar="2" class="fn"></div>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li><div bar="2" class="fn"></div>1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"></div>4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li><div class="fn"></div>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li><div class="fn"></div>1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QSpinBox class provides a spin box widget.</p>
<p>QSpinBox is designed to handle integers and discrete sets of values (e.g&#x2e;, month names); use <a href="qdoublespinbox.html">QDoubleSpinBox</a> for floating point values.</p>
<p>QSpinBox allows the user to choose a value by clicking the up/down buttons or pressing up/down on the keyboard to increase/decrease the value currently displayed. The user can also type the value in manually. The spin box supports integer values but can be extended to use different strings with <a href="qspinbox.html#validate">validate</a>(), <a href="qspinbox.html#textFromValue">textFromValue</a>() and <a href="qspinbox.html#valueFromText">valueFromText</a>().</p>
<p>Every time the value changes QSpinBox emits the <a href="qspinbox.html#valueChanged">valueChanged</a>() signals. The current value can be fetched with <a href="qspinbox.html#value-prop">value</a>() and set with <a href="qspinbox.html#value-prop">setValue</a>().</p>
<p>Clicking the up/down buttons or using the keyboard accelerator's up and down arrows will increase or decrease the current value in steps of size <a href="qspinbox.html#singleStep-prop">singleStep</a>(). If you want to change this behaviour you can reimplement the virtual function <a href="qabstractspinbox.html#stepBy">stepBy</a>(). The minimum and maximum value and the step size can be set using one of the constructors, and can be changed later with <a href="qspinbox.html#minimum-prop">setMinimum</a>(), <a href="qspinbox.html#maximum-prop">setMaximum</a>() and <a href="qspinbox.html#singleStep-prop">setSingleStep</a>().</p>
<p>Most spin boxes are directional, but QSpinBox can also operate as a circular spin box, i.e&#x2e; if the range is 0-99 and the current value is 99, clicking &quot;up&quot; will give 0 if <a href="qabstractspinbox.html#wrapping-prop">wrapping</a>() is set to true. Use <a href="qabstractspinbox.html#wrapping-prop">setWrapping</a>() if you want circular behavior.</p>
<p>The displayed value can be prepended and appended with arbitrary strings indicating, for example, currency or the unit of measurement. See <a href="qspinbox.html#prefix-prop">setPrefix</a>() and <a href="qspinbox.html#suffix-prop">setSuffix</a>(). The text in the spin box is retrieved with <a href="qabstractspinbox.html#text-prop">text</a>() (which includes any <a href="qspinbox.html#prefix-prop">prefix</a>() and <a href="qspinbox.html#suffix-prop">suffix</a>()), or with <a href="qspinbox.html#cleanText-prop">cleanText</a>() (which has no <a href="qspinbox.html#prefix-prop">prefix</a>(), no <a href="qspinbox.html#suffix-prop">suffix</a>() and no leading or trailing whitespace).</p>
<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="qabstractspinbox.html#specialValueText-prop">setSpecialValueText</a>() for how to do this with QSpinBox.</p>
<p><table class="generic" width="100%" align="center" cellpadding="2" cellspacing="1" border="0">
<tr valign="top" class="odd"><td><img src="images/windowsxp-spinbox.png" alt="Screenshot of a Windows XP spin box" /></td><td>A spin box shown in the <a href="gallery-windowsxp.html">Windows XP widget style</a>.</td></tr>
<tr valign="top" class="even"><td><img src="images/plastique-spinbox.png" alt="Screenshot of a Plastique spin box" /></td><td>A spin box shown in the <a href="gallery-plastique.html">Plastique widget style</a>.</td></tr>
<tr valign="top" class="odd"><td><img src="images/macintosh-spinbox.png" alt="Screenshot of a Macintosh spin box" /></td><td>A spin box shown in the <a href="gallery-macintosh.html">Macintosh widget style</a>.</td></tr>
</table></p>
<a name="subclassing-qspinbox"></a>
<h3>Subclassing QSpinBox</h3>
<p>If using <a href="qspinbox.html#prefix-prop">prefix</a>(), <a href="qspinbox.html#suffix-prop">suffix</a>(), and <a href="qabstractspinbox.html#specialValueText-prop">specialValueText</a>() don't provide enough control, you subclass QSpinBox and reimplement <a href="qspinbox.html#valueFromText">valueFromText</a>() and <a href="qspinbox.html#textFromValue">textFromValue</a>(). For example, here's the code for a custom spin box that allows the user to enter icon sizes (e.g&#x2e;, &quot;32 x 32&quot;):</p>
<pre> int IconSizeSpinBox::valueFromText(const QString &amp;text) const
 {
     QRegExp regExp(tr(&quot;(\\d+)(\\s*[xx]\\s*\\d+)?&quot;));

     if (regExp.exactMatch(text)) {
         return regExp.cap(1).toInt();
     } else {
         return 0;
     }
 }

 QString IconSizeSpinBox::textFromValue(int value) const
 {
     return tr(&quot;%1 x %1&quot;).arg(value);
 }</pre>
<p>See the <a href="widgets-icons.html">Icons</a> example for the full source code.</p>
<p>See also <a href="qdoublespinbox.html">QDoubleSpinBox</a>, <a href="qdatetimeedit.html">QDateTimeEdit</a>, <a href="qslider.html">QSlider</a>, and <a href="widgets-spinboxes.html">Spin Boxes Example</a>.</p>
<hr />
<h2>Property Documentation</h2>
<a name="//apple_ref/cpp/instm/QSpinBox/cleanText"></a>
<h3 class="fn"><a name="cleanText-prop"></a>cleanText : const <a href="qstring.html">QString</a></h3>
<p>This property holds the text of the spin box excluding any prefix, suffix, or leading or trailing whitespace.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b>cleanText</b> () const</td></tr>
</table>
<p>See also <a href="qabstractspinbox.html#text-prop">text</a>, <a href="qspinbox.html#prefix-prop">QSpinBox::prefix</a>, and <a href="qspinbox.html#suffix-prop">QSpinBox::suffix</a>.</p>
<a name="//apple_ref/cpp/instm/QSpinBox/maximum"></a>
<a name="//apple_ref/cpp/instm/QSpinBox/setMaximum"></a>
<h3 class="fn"><a name="maximum-prop"></a>maximum : int</h3>
<p>This property holds the maximum value of the spin box.</p>
<p>When setting this property the <a href="qspinbox.html#minimum-prop">minimum</a> is adjusted if necessary, to ensure that the range remains valid.</p>
<p>The default maximum value is 99.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b>maximum</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setMaximum</b> ( int <i>max</i> )</td></tr>
</table>
<p>See also <a href="qspinbox.html#setRange">setRange</a>() and <a href="qabstractspinbox.html#specialValueText-prop">specialValueText</a>.</p>
<a name="//apple_ref/cpp/instm/QSpinBox/minimum"></a>
<a name="//apple_ref/cpp/instm/QSpinBox/setMinimum"></a>
<h3 class="fn"><a name="minimum-prop"></a>minimum : int</h3>
<p>This property holds the minimum value of the spin box.</p>
<p>When setting this property the <a href="qspinbox.html#maximum-prop">maximum</a> is adjusted if necessary to ensure that the range remains valid.</p>
<p>The default minimum value is 0.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b>minimum</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setMinimum</b> ( int <i>min</i> )</td></tr>
</table>
<p>See also <a href="qspinbox.html#setRange">setRange</a>() and <a href="qabstractspinbox.html#specialValueText-prop">specialValueText</a>.</p>
<a name="//apple_ref/cpp/instm/QSpinBox/prefix"></a>
<a name="//apple_ref/cpp/instm/QSpinBox/setPrefix"></a>
<h3 class="fn"><a name="prefix-prop"></a>prefix : <a href="qstring.html">QString</a></h3>
<p>This property holds the spin box's prefix.</p>
<p>The prefix is prepended to the start of the displayed value. Typical use is to display a unit of measurement or a currency symbol. For example:</p>
<pre> sb-&gt;setPrefix(&quot;$&quot;);</pre>
<p>To turn off the prefix display, set this property to an empty string. The default is no prefix. The prefix is not displayed when <a href="qspinbox.html#value-prop">value</a>() == <a href="qspinbox.html#minimum-prop">minimum</a>() and <a href="qabstractspinbox.html#specialValueText-prop">specialValueText</a>() is set.</p>
<p>If no prefix is set, prefix() returns an empty string.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b>prefix</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setPrefix</b> ( const QString &amp; <i>prefix</i> )</td></tr>
</table>
<p>See also <a href="qspinbox.html#suffix-prop">suffix</a>(), <a href="qspinbox.html#suffix-prop">setSuffix</a>(), <a href="qabstractspinbox.html#specialValueText-prop">specialValueText</a>(), and <a href="qabstractspinbox.html#specialValueText-prop">setSpecialValueText</a>().</p>
<a name="//apple_ref/cpp/instm/QSpinBox/singleStep"></a>
<a name="//apple_ref/cpp/instm/QSpinBox/setSingleStep"></a>
<h3 class="fn"><a name="singleStep-prop"></a>singleStep : int</h3>
<p>This property holds the step value.</p>
<p>When the user uses the arrows to change the spin box's value the value will be incremented/decremented by the amount of the singleStep. The default value is 1. Setting a singleStep value of less than 0 does nothing.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b>singleStep</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setSingleStep</b> ( int <i>val</i> )</td></tr>
</table>
<a name="//apple_ref/cpp/instm/QSpinBox/suffix"></a>
<a name="//apple_ref/cpp/instm/QSpinBox/setSuffix"></a>
<h3 class="fn"><a name="suffix-prop"></a>suffix : <a href="qstring.html">QString</a></h3>
<p>This property holds the suffix of the spin box.</p>
<p>The suffix is appended to the end of the displayed value. Typical use is to display a unit of measurement or a currency symbol. For example:</p>
<pre> sb-&gt;setSuffix(&quot; km&quot;);</pre>
<p>To turn off the suffix display, set this property to an empty string. The default is no suffix. The suffix is not displayed for the <a href="qspinbox.html#minimum-prop">minimum</a>() if <a href="qabstractspinbox.html#specialValueText-prop">specialValueText</a>() is set.</p>
<p>If no suffix is set, suffix() returns an empty string.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b>suffix</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setSuffix</b> ( const QString &amp; <i>suffix</i> )</td></tr>
</table>
<p>See also <a href="qspinbox.html#prefix-prop">prefix</a>(), <a href="qspinbox.html#prefix-prop">setPrefix</a>(), <a href="qabstractspinbox.html#specialValueText-prop">specialValueText</a>(), and <a href="qabstractspinbox.html#specialValueText-prop">setSpecialValueText</a>().</p>
<a name="//apple_ref/cpp/instm/QSpinBox/value"></a>
<a name="//apple_ref/cpp/instm/QSpinBox/setValue"></a>
<a name="//apple_ref/cpp/instm/QSpinBox/valueChanged"></a>
<h3 class="fn"><a name="value-prop"></a>value : int</h3>
<p>This property holds the value of the spin box.</p>
<p>setValue() will emit <a href="qspinbox.html#valueChanged">valueChanged</a>() if the new value is different from the old one.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b>value</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setValue</b> ( int <i>val</i> )</td></tr>
</table>
<p><b>Notifier signal:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qspinbox.html#valueChanged">valueChanged</a></b> ( int <i>i</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qspinbox.html#valueChanged-2">valueChanged</a></b> ( const QString &amp; <i>text</i> )</td></tr>
</table>
<hr />
<h2>Member Function Documentation</h2>
<a name="//apple_ref/cpp/instm/QSpinBox/QSpinBox"></a>
<h3 class="fn"><a name="QSpinBox"></a>QSpinBox::QSpinBox ( <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0 )</h3>
<p>Constructs a spin box with 0 as minimum value and 99 as maximum value, a step value of 1. The value is initially set to 0. It is parented to <i>parent</i>.</p>
<p>See also <a href="qspinbox.html#minimum-prop">setMinimum</a>(), <a href="qspinbox.html#maximum-prop">setMaximum</a>(), and <a href="qspinbox.html#singleStep-prop">setSingleStep</a>().</p>
<a name="//apple_ref/cpp/instm/QSpinBox/event"></a>
<h3 class="fn"><a name="event"></a>bool QSpinBox::event ( <a href="qevent.html">QEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qobject.html#event">QObject::event</a>().</p>
<a name="//apple_ref/cpp/instm/QSpinBox/fixup"></a>
<h3 class="fn"><a name="fixup"></a>void QSpinBox::fixup ( <a href="qstring.html">QString</a> &amp; <i>input</i> ) const&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qabstractspinbox.html#fixup">QAbstractSpinBox::fixup</a>().</p>
<a name="//apple_ref/cpp/instm/QSpinBox/setRange"></a>
<h3 class="fn"><a name="setRange"></a>void QSpinBox::setRange ( int <i>minimum</i>, int <i>maximum</i> )</h3>
<p>Convenience function to set the <i>minimum</i>, and <i>maximum</i> values with a single function call.</p>
<pre> setRange(minimum, maximum);</pre>
<p>is equivalent to:</p>
<pre> setMinimum(minimum);
 setMaximum(maximum);</pre>
<p>See also <a href="qspinbox.html#minimum-prop">minimum</a> and <a href="qspinbox.html#maximum-prop">maximum</a>.</p>
<a name="//apple_ref/cpp/instm/QSpinBox/textFromValue"></a>
<h3 class="fn"><a name="textFromValue"></a><a href="qstring.html">QString</a> QSpinBox::textFromValue ( int <i>value</i> ) const&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>This virtual function is used by the spin box whenever it needs to display the given <i>value</i>. The default implementation returns a string containing <i>value</i> printed in the standard way using <a href="qwidget.html#locale-prop">QWidget::locale</a>().toString(), but with the thousand separator removed. Reimplementations may return anything. (See the example in the detailed description.)</p>
<p>Note: <a href="qspinbox.html">QSpinBox</a> does not call this function for <a href="qabstractspinbox.html#specialValueText-prop">specialValueText</a>() and that neither <a href="qspinbox.html#prefix-prop">prefix</a>() nor <a href="qspinbox.html#suffix-prop">suffix</a>() should be included in the return value.</p>
<p>If you reimplement this, you may also need to reimplement <a href="qspinbox.html#valueFromText">valueFromText</a>() and <a href="qspinbox.html#validate">validate</a>()</p>
<p>See also <a href="qspinbox.html#valueFromText">valueFromText</a>(), <a href="qspinbox.html#validate">validate</a>(), and <a href="qlocale.html#groupSeparator">QLocale::groupSeparator</a>().</p>
<a name="//apple_ref/cpp/instm/QSpinBox/validate"></a>
<h3 class="fn"><a name="validate"></a><a href="qvalidator.html#State-enum">QValidator::State</a> QSpinBox::validate ( <a href="qstring.html">QString</a> &amp; <i>text</i>, int &amp; <i>pos</i> ) const&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qabstractspinbox.html#validate">QAbstractSpinBox::validate</a>().</p>
<a name="//apple_ref/cpp/instm/QSpinBox/valueChanged"></a>
<h3 class="fn"><a name="valueChanged"></a>void QSpinBox::valueChanged ( int <i>i</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is emitted whenever the spin box's value is changed. The new value's integer value is passed in <i>i</i>.</p>
<h3 class="fn"><a name="valueChanged-2"></a>void QSpinBox::valueChanged ( const <a href="qstring.html">QString</a> &amp; <i>text</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This is an overloaded function.</p>
<p>The new value is passed literally in <i>text</i> with no <a href="qspinbox.html#prefix-prop">prefix</a>() or <a href="qspinbox.html#suffix-prop">suffix</a>().</p>
<a name="//apple_ref/cpp/instm/QSpinBox/valueFromText"></a>
<h3 class="fn"><a name="valueFromText"></a>int QSpinBox::valueFromText ( const <a href="qstring.html">QString</a> &amp; <i>text</i> ) const&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>This virtual function is used by the spin box whenever it needs to interpret <i>text</i> entered by the user as a value.</p>
<p>Subclasses that need to display spin box values in a non-numeric way need to reimplement this function.</p>
<p>Note: <a href="qspinbox.html">QSpinBox</a> handles <a href="qabstractspinbox.html#specialValueText-prop">specialValueText</a>() separately; this function is only concerned with the other values.</p>
<p>See also <a href="qspinbox.html#textFromValue">textFromValue</a>() and <a href="qspinbox.html#validate">validate</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="40%" align="left">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="40%" align="right"><div align="right">Qt 4.6.3</div></td>
</tr></table></div></address></body>
</html>