summaryrefslogtreecommitdiffstats
path: root/doc/html/qdoublevalidator.html
blob: 81764a7acbb5adb4f4406b98881869bf8001d674 (plain)
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/widgets/qvalidator.cpp:348 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>TQDoubleValidator Class</title>
<style type="text/css"><!--
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
 <a href="index.html">
<font color="#004faf">Home</font></a>
 | <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
 | <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
 | <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
 | <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>TQDoubleValidator Class Reference</h1>

<p>The TQDoubleValidator class provides range checking of
floating-point numbers.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qvalidator-h.html">ntqvalidator.h</a>&gt;</tt>
<p>Inherits <a href="ntqvalidator.html">TQValidator</a>.
<p><a href="qdoublevalidator-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn><a href="#TQDoubleValidator"><b>TQDoubleValidator</b></a> ( TQObject&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
<li class=fn><a href="#TQDoubleValidator-2"><b>TQDoubleValidator</b></a> ( double&nbsp;bottom, double&nbsp;top, int&nbsp;decimals, TQObject&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
<li class=fn><a href="#~TQDoubleValidator"><b>~TQDoubleValidator</b></a> ()</li>
<li class=fn>virtual TQValidator::State <a href="#validate"><b>validate</b></a> ( TQString&nbsp;&amp;&nbsp;input, int &amp; ) const</li>
<li class=fn>virtual void <a href="#setRange"><b>setRange</b></a> ( double&nbsp;minimum, double&nbsp;maximum, int&nbsp;decimals = 0 )</li>
<li class=fn>void <a href="#setBottom"><b>setBottom</b></a> ( double )</li>
<li class=fn>void <a href="#setTop"><b>setTop</b></a> ( double )</li>
<li class=fn>void <a href="#setDecimals"><b>setDecimals</b></a> ( int )</li>
<li class=fn>double <a href="#bottom"><b>bottom</b></a> () const</li>
<li class=fn>double <a href="#top"><b>top</b></a> () const</li>
<li class=fn>int <a href="#decimals"><b>decimals</b></a> () const</li>
</ul>
<h2>Properties</h2>
<ul>
<li class=fn>double <a href="#bottom-prop"><b>bottom</b></a>&nbsp;- the validator's minimum acceptable value</li>
<li class=fn>int <a href="#decimals-prop"><b>decimals</b></a>&nbsp;- the validator's maximum number of digits after the decimal point</li>
<li class=fn>double <a href="#top-prop"><b>top</b></a>&nbsp;- the validator's maximum acceptable value</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>


<p> The TQDoubleValidator class provides range checking of
floating-point numbers.
<p> 
<p> TQDoubleValidator provides an upper bound, a lower bound and a
limit on the number of digits after the decimal point. It does not
provide a <a href="ntqvalidator.html#fixup">fixup</a>() function.
<p> You can set the acceptable range in one call with <a href="#setRange">setRange</a>(), or
with <a href="#setBottom">setBottom</a>() and <a href="#setTop">setTop</a>(). Set the number of decimal places
with <a href="#setDecimals">setDecimals</a>(). The <a href="#validate">validate</a>() function returns the validation
state.
<p> <p>See also <a href="qintvalidator.html">TQIntValidator</a>, <a href="tqregexpvalidator.html">TQRegExpValidator</a>, and <a href="misc.html">Miscellaneous Classes</a>.

<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="TQDoubleValidator"></a>TQDoubleValidator::TQDoubleValidator ( <a href="tqobject.html">TQObject</a>&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0 )
</h3>
Constructs a validator object with parent <em>parent</em>, called <em>name</em>, which accepts any double.

<h3 class=fn><a name="TQDoubleValidator-2"></a>TQDoubleValidator::TQDoubleValidator ( double&nbsp;bottom, double&nbsp;top, int&nbsp;decimals, <a href="tqobject.html">TQObject</a>&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0 )
</h3>
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>
inclusive, with up to <em>decimals</em> digits after the decimal point.

<h3 class=fn><a name="~TQDoubleValidator"></a>TQDoubleValidator::~TQDoubleValidator ()
</h3>
Destroys the validator, freeing any resources used.

<h3 class=fn>double <a name="bottom"></a>TQDoubleValidator::bottom () const
</h3><p>Returns the validator's minimum acceptable value.
See the <a href="qdoublevalidator.html#bottom-prop">"bottom"</a> property for details.
<h3 class=fn>int <a name="decimals"></a>TQDoubleValidator::decimals () const
</h3><p>Returns the validator's maximum number of digits after the decimal point.
See the <a href="qdoublevalidator.html#decimals-prop">"decimals"</a> property for details.
<h3 class=fn>void <a name="setBottom"></a>TQDoubleValidator::setBottom ( double )
</h3><p>Sets the validator's minimum acceptable value.
See the <a href="qdoublevalidator.html#bottom-prop">"bottom"</a> property for details.
<h3 class=fn>void <a name="setDecimals"></a>TQDoubleValidator::setDecimals ( int )
</h3><p>Sets the validator's maximum number of digits after the decimal point.
See the <a href="qdoublevalidator.html#decimals-prop">"decimals"</a> property for details.
<h3 class=fn>void <a name="setRange"></a>TQDoubleValidator::setRange ( double&nbsp;minimum, double&nbsp;maximum, int&nbsp;decimals = 0 )<tt> [virtual]</tt>
</h3>
Sets the validator to accept doubles from <em>minimum</em> to <em>maximum</em>
inclusive, with at most <em>decimals</em> digits after the decimal
point.

<h3 class=fn>void <a name="setTop"></a>TQDoubleValidator::setTop ( double )
</h3><p>Sets the validator's maximum acceptable value.
See the <a href="qdoublevalidator.html#top-prop">"top"</a> property for details.
<h3 class=fn>double <a name="top"></a>TQDoubleValidator::top () const
</h3><p>Returns the validator's maximum acceptable value.
See the <a href="qdoublevalidator.html#top-prop">"top"</a> property for details.
<h3 class=fn><a href="ntqvalidator.html#State-enum">TQValidator::State</a> <a name="validate"></a>TQDoubleValidator::validate ( <a href="tqstring.html">TQString</a>&nbsp;&amp;&nbsp;input, int &amp; ) const<tt> [virtual]</tt>
</h3>
Returns <a href="ntqvalidator.html#State-enum">Acceptable</a> if the string <em>input</em> contains a double
that is within the valid range and is in the correct format.
<p> Returns <a href="ntqvalidator.html#State-enum">Intermediate</a> if <em>input</em> contains a double that is
outside the range or is in the wrong format, e.g. with too many
digits after the decimal point or is empty.
<p> Returns <a href="ntqvalidator.html#State-enum">Invalid</a> if the <em>input</em> is not a double.
<p> Note: If the valid range consists of just positive doubles (e.g. 0.0 - 100.0)
and <em>input</em> is a negative double then Invalid is returned.

<p>Reimplemented from <a href="ntqvalidator.html#validate">TQValidator</a>.
<hr><h2>Property Documentation</h2>
<h3 class=fn>double <a name="bottom-prop"></a>bottom</h3>
<p>This property holds the validator's minimum acceptable value.
<p>Set this property's value with <a href="#setBottom">setBottom</a>() and get this property's value with <a href="#bottom">bottom</a>().
<p><p>See also <a href="#setRange">setRange</a>().

<h3 class=fn>int <a name="decimals-prop"></a>decimals</h3>
<p>This property holds the validator's maximum number of digits after the decimal point.
<p>Set this property's value with <a href="#setDecimals">setDecimals</a>() and get this property's value with <a href="#decimals">decimals</a>().
<p><p>See also <a href="#setRange">setRange</a>().

<h3 class=fn>double <a name="top-prop"></a>top</h3>
<p>This property holds the validator's maximum acceptable value.
<p>Set this property's value with <a href="#setTop">setTop</a>() and get this property's value with <a href="#top">top</a>().
<p><p>See also <a href="#setRange">setRange</a>().

<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">TQt toolkit</a>.
Copyright &copy; 1995-2007
<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 &copy; 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>TQt 3.3.8</div>
</table></div></address></body>
</html>