<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>TQValidator Class Reference</h1>
<p>The TQValidator class provides validation of input text.
<p>Inherited by <ahref="qintvalidator.html">TQIntValidator</a>, <ahref="qdoublevalidator.html">TQDoubleValidator</a>, and <ahref="qregexpvalidator.html">TQRegExpValidator</a>.
<p><ahref="qvalidator-members.html">List of all member functions.</a>
<ahref="qdoublevalidator.html">TQDoubleValidator</a>, provide basic numeric-range checking, and <ahref="qregexpvalidator.html">TQRegExpValidator</a> provides general checking using a custom <ahref="ntqregexp.html#regular-expression">regular expression</a>.
is <em>clearly</em> invalid. <ahref="#State-enum">Intermediate</a> is less obvious: the
concept of validity is slippery when the string is incomplete
(still being edited). TQValidator defines <ahref="#State-enum">Intermediate</a> as the
property of a string that is neither clearly invalid nor
acceptable as a final result. <ahref="#State-enum">Acceptable</a> means that the string
is acceptable as a final result. One might say that any string
that is a plausible intermediate state during entry of an <ahref="#State-enum">Acceptable</a> string is <ahref="#State-enum">Intermediate</a>.
<p> Here are some examples:
<p><ul>
<p><li> For a line edit that accepts integers from 0 to 999 inclusive,
42 and 123 are <ahref="#State-enum">Acceptable</a>, the empty string and 1114 are <ahref="#State-enum">Intermediate</a> and asdf is <ahref="#State-enum">Invalid</a>.
<p><li> For an editable combobox that accepts URLs, any well-formed URL
is <ahref="#State-enum">Acceptable</a>, "http://www.trolltech.com/," is <ahref="#State-enum">Intermediate</a>
(it might be a cut and paste operation that accidentally took in a
comma at the end), the empty string is <ahref="#State-enum">Intermediate</a> (the user
might select and delete all of the text in preparation for entering
a new URL), and "http:///./" is <ahref="#State-enum">Invalid</a>.
<p><li> For a spin box that accepts lengths, "11cm" and "1in" are <ahref="#State-enum">Acceptable</a>, "11" and the empty string are <ahref="#State-enum">Intermediate</a> and
"http://www.trolltech.com" and "hour" are <ahref="#State-enum">Invalid</a>.
<p></ul>
<p><ahref="#fixup">fixup</a>() is provided for validators that can repair some user
<p> This pure virtual function returns <ahref="#State-enum">Invalid</a> if <em>input</em> is
invalid according to this validator's rules, <ahref="#State-enum">Intermediate</a> if it
is likely that a little more editing will make the input
acceptable (e.g. the user types '4' into a widget which accepts
integers between 10 and 99) and <ahref="#State-enum">Acceptable</a> if the input is
valid.
<p> The function can change <em>input</em> and <em>pos</em> (the cursor position)
if it wants to.
<p>Reimplemented in <ahref="qintvalidator.html#validate">TQIntValidator</a>, <ahref="qdoublevalidator.html#validate">TQDoubleValidator</a>, and <ahref="qregexpvalidator.html#validate">TQRegExpValidator</a>.
<!-- eof -->
<hr><p>
This file is part of the <ahref="index.html">TQt toolkit</a>.