[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/src/widgets/qvalidator.cpp:348 -->
|
---|
| 3 | <html>
|
---|
| 4 | <head>
|
---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
| 6 | <title>QDoubleValidator Class</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>QDoubleValidator Class Reference</h1>
|
---|
| 33 |
|
---|
| 34 | <p>The QDoubleValidator class provides range checking of
|
---|
| 35 | floating-point numbers.
|
---|
| 36 | <a href="#details">More...</a>
|
---|
| 37 | <p><tt>#include <<a href="qvalidator-h.html">qvalidator.h</a>></tt>
|
---|
| 38 | <p>Inherits <a href="qvalidator.html">QValidator</a>.
|
---|
| 39 | <p><a href="qdoublevalidator-members.html">List of all member functions.</a>
|
---|
| 40 | <h2>Public Members</h2>
|
---|
| 41 | <ul>
|
---|
| 42 | <li class=fn><a href="#QDoubleValidator"><b>QDoubleValidator</b></a> ( QObject * parent, const char * name = 0 )</li>
|
---|
| 43 | <li class=fn><a href="#QDoubleValidator-2"><b>QDoubleValidator</b></a> ( double bottom, double top, int decimals, QObject * parent, const char * name = 0 )</li>
|
---|
| 44 | <li class=fn><a href="#~QDoubleValidator"><b>~QDoubleValidator</b></a> ()</li>
|
---|
| 45 | <li class=fn>virtual QValidator::State <a href="#validate"><b>validate</b></a> ( QString & input, int & ) const</li>
|
---|
| 46 | <li class=fn>virtual void <a href="#setRange"><b>setRange</b></a> ( double minimum, double maximum, int decimals = 0 )</li>
|
---|
| 47 | <li class=fn>void <a href="#setBottom"><b>setBottom</b></a> ( double )</li>
|
---|
| 48 | <li class=fn>void <a href="#setTop"><b>setTop</b></a> ( double )</li>
|
---|
| 49 | <li class=fn>void <a href="#setDecimals"><b>setDecimals</b></a> ( int )</li>
|
---|
| 50 | <li class=fn>double <a href="#bottom"><b>bottom</b></a> () const</li>
|
---|
| 51 | <li class=fn>double <a href="#top"><b>top</b></a> () const</li>
|
---|
| 52 | <li class=fn>int <a href="#decimals"><b>decimals</b></a> () const</li>
|
---|
| 53 | </ul>
|
---|
| 54 | <h2>Properties</h2>
|
---|
| 55 | <ul>
|
---|
| 56 | <li class=fn>double <a href="#bottom-prop"><b>bottom</b></a> - the validator's minimum acceptable value</li>
|
---|
| 57 | <li class=fn>int <a href="#decimals-prop"><b>decimals</b></a> - the validator's maximum number of digits after the decimal point</li>
|
---|
| 58 | <li class=fn>double <a href="#top-prop"><b>top</b></a> - the validator's maximum acceptable value</li>
|
---|
| 59 | </ul>
|
---|
| 60 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
| 61 |
|
---|
| 62 |
|
---|
| 63 | <p> The QDoubleValidator class provides range checking of
|
---|
| 64 | floating-point numbers.
|
---|
| 65 | <p>
|
---|
| 66 | <p> QDoubleValidator provides an upper bound, a lower bound and a
|
---|
| 67 | limit on the number of digits after the decimal point. It does not
|
---|
| 68 | provide a <a href="qvalidator.html#fixup">fixup</a>() function.
|
---|
| 69 | <p> You can set the acceptable range in one call with <a href="#setRange">setRange</a>(), or
|
---|
| 70 | with <a href="#setBottom">setBottom</a>() and <a href="#setTop">setTop</a>(). Set the number of decimal places
|
---|
| 71 | with <a href="#setDecimals">setDecimals</a>(). The <a href="#validate">validate</a>() function returns the validation
|
---|
| 72 | state.
|
---|
| 73 | <p> <p>See also <a href="qintvalidator.html">QIntValidator</a>, <a href="qregexpvalidator.html">QRegExpValidator</a>, and <a href="misc.html">Miscellaneous Classes</a>.
|
---|
| 74 |
|
---|
| 75 | <hr><h2>Member Function Documentation</h2>
|
---|
| 76 | <h3 class=fn><a name="QDoubleValidator"></a>QDoubleValidator::QDoubleValidator ( <a href="qobject.html">QObject</a> * parent, const char * name = 0 )
|
---|
| 77 | </h3>
|
---|
| 78 | Constructs a validator object with parent <em>parent</em>, called <em>name</em>, which accepts any double.
|
---|
| 79 |
|
---|
| 80 | <h3 class=fn><a name="QDoubleValidator-2"></a>QDoubleValidator::QDoubleValidator ( double bottom, double top, int decimals, <a href="qobject.html">QObject</a> * parent, const char * name = 0 )
|
---|
| 81 | </h3>
|
---|
| 82 | Constructs a validator object with parent <em>parent</em>, called <em>name</em>. This validator will accept doubles from <em>bottom</em> to <em>top</em>
|
---|
| 83 | inclusive, with up to <em>decimals</em> digits after the decimal point.
|
---|
| 84 |
|
---|
| 85 | <h3 class=fn><a name="~QDoubleValidator"></a>QDoubleValidator::~QDoubleValidator ()
|
---|
| 86 | </h3>
|
---|
| 87 | Destroys the validator, freeing any resources used.
|
---|
| 88 |
|
---|
| 89 | <h3 class=fn>double <a name="bottom"></a>QDoubleValidator::bottom () const
|
---|
| 90 | </h3><p>Returns the validator's minimum acceptable value.
|
---|
| 91 | See the <a href="qdoublevalidator.html#bottom-prop">"bottom"</a> property for details.
|
---|
| 92 | <h3 class=fn>int <a name="decimals"></a>QDoubleValidator::decimals () const
|
---|
| 93 | </h3><p>Returns the validator's maximum number of digits after the decimal point.
|
---|
| 94 | See the <a href="qdoublevalidator.html#decimals-prop">"decimals"</a> property for details.
|
---|
| 95 | <h3 class=fn>void <a name="setBottom"></a>QDoubleValidator::setBottom ( double )
|
---|
| 96 | </h3><p>Sets the validator's minimum acceptable value.
|
---|
| 97 | See the <a href="qdoublevalidator.html#bottom-prop">"bottom"</a> property for details.
|
---|
| 98 | <h3 class=fn>void <a name="setDecimals"></a>QDoubleValidator::setDecimals ( int )
|
---|
| 99 | </h3><p>Sets the validator's maximum number of digits after the decimal point.
|
---|
| 100 | See the <a href="qdoublevalidator.html#decimals-prop">"decimals"</a> property for details.
|
---|
| 101 | <h3 class=fn>void <a name="setRange"></a>QDoubleValidator::setRange ( double minimum, double maximum, int decimals = 0 )<tt> [virtual]</tt>
|
---|
| 102 | </h3>
|
---|
| 103 | Sets the validator to accept doubles from <em>minimum</em> to <em>maximum</em>
|
---|
| 104 | inclusive, with at most <em>decimals</em> digits after the decimal
|
---|
| 105 | point.
|
---|
| 106 |
|
---|
| 107 | <h3 class=fn>void <a name="setTop"></a>QDoubleValidator::setTop ( double )
|
---|
| 108 | </h3><p>Sets the validator's maximum acceptable value.
|
---|
| 109 | See the <a href="qdoublevalidator.html#top-prop">"top"</a> property for details.
|
---|
| 110 | <h3 class=fn>double <a name="top"></a>QDoubleValidator::top () const
|
---|
| 111 | </h3><p>Returns the validator's maximum acceptable value.
|
---|
| 112 | See the <a href="qdoublevalidator.html#top-prop">"top"</a> property for details.
|
---|
| 113 | <h3 class=fn><a href="qvalidator.html#State-enum">QValidator::State</a> <a name="validate"></a>QDoubleValidator::validate ( <a href="qstring.html">QString</a> & input, int & ) const<tt> [virtual]</tt>
|
---|
| 114 | </h3>
|
---|
| 115 | Returns <a href="qvalidator.html#State-enum">Acceptable</a> if the string <em>input</em> contains a double
|
---|
| 116 | that is within the valid range and is in the correct format.
|
---|
| 117 | <p> Returns <a href="qvalidator.html#State-enum">Intermediate</a> if <em>input</em> contains a double that is
|
---|
| 118 | outside the range or is in the wrong format, e.g. with too many
|
---|
| 119 | digits after the decimal point or is empty.
|
---|
| 120 | <p> Returns <a href="qvalidator.html#State-enum">Invalid</a> if the <em>input</em> is not a double.
|
---|
| 121 | <p> Note: If the valid range consists of just positive doubles (e.g. 0.0 - 100.0)
|
---|
| 122 | and <em>input</em> is a negative double then Invalid is returned.
|
---|
| 123 |
|
---|
| 124 | <p>Reimplemented from <a href="qvalidator.html#validate">QValidator</a>.
|
---|
| 125 | <hr><h2>Property Documentation</h2>
|
---|
| 126 | <h3 class=fn>double <a name="bottom-prop"></a>bottom</h3>
|
---|
| 127 | <p>This property holds the validator's minimum acceptable value.
|
---|
| 128 | <p>Set this property's value with <a href="#setBottom">setBottom</a>() and get this property's value with <a href="#bottom">bottom</a>().
|
---|
| 129 | <p><p>See also <a href="#setRange">setRange</a>().
|
---|
| 130 |
|
---|
| 131 | <h3 class=fn>int <a name="decimals-prop"></a>decimals</h3>
|
---|
| 132 | <p>This property holds the validator's maximum number of digits after the decimal point.
|
---|
| 133 | <p>Set this property's value with <a href="#setDecimals">setDecimals</a>() and get this property's value with <a href="#decimals">decimals</a>().
|
---|
| 134 | <p><p>See also <a href="#setRange">setRange</a>().
|
---|
| 135 |
|
---|
| 136 | <h3 class=fn>double <a name="top-prop"></a>top</h3>
|
---|
| 137 | <p>This property holds the validator's maximum acceptable value.
|
---|
| 138 | <p>Set this property's value with <a href="#setTop">setTop</a>() and get this property's value with <a href="#top">top</a>().
|
---|
| 139 | <p><p>See also <a href="#setRange">setRange</a>().
|
---|
| 140 |
|
---|
| 141 | <!-- eof -->
|
---|
| 142 | <hr><p>
|
---|
| 143 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
| 144 | Copyright © 1995-2007
|
---|
| 145 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
| 146 | <table width=100% cellspacing=0 border=0><tr>
|
---|
| 147 | <td>Copyright © 2007
|
---|
| 148 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
| 149 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
| 150 | </table></div></address></body>
|
---|
| 151 | </html>
|
---|