Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 112b0974ad288f6cd55bf971ee6026a9 > files > 1435

libqt3-devel-3.0.2-2mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /tmp/qt-3.0-reggie-28534/qt-x11-free-3.0.2/src/widgets/qvalidator.cpp:180 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>QIntValidator 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: #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>QIntValidator Class Reference</h1>

<p>The QIntValidator class provides a validator which ensures that
a string contains a valid integer within a specified range.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qvalidator-h.html">qvalidator.h</a>&gt;</tt>
<p>Inherits <a href="qvalidator.html">QValidator</a>.
<p><a href="qintvalidator-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class=fn><a href="#QIntValidator"><b>QIntValidator</b></a> ( QObject&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0 )</div></li>
<li><div class=fn><a href="#QIntValidator-2"><b>QIntValidator</b></a> ( int&nbsp;minimum, int&nbsp;maximum, QObject&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0 )</div></li>
<li><div class=fn><a href="#~QIntValidator"><b>~QIntValidator</b></a> ()</div></li>
<li><div class=fn>virtual QValidator::State <a href="#validate"><b>validate</b></a> ( QString&nbsp;&amp;&nbsp;input, int &amp; ) const</div></li>
<li><div class=fn>void <a href="#setBottom"><b>setBottom</b></a> ( int )</div></li>
<li><div class=fn>void <a href="#setTop"><b>setTop</b></a> ( int )</div></li>
<li><div class=fn>virtual void <a href="#setRange"><b>setRange</b></a> ( int&nbsp;minimum, int&nbsp;maximum )</div></li>
<li><div class=fn>int <a href="#bottom"><b>bottom</b></a> () const</div></li>
<li><div class=fn>int <a href="#top"><b>top</b></a> () const</div></li>
</ul>
<h2>Properties</h2>
<ul>
<li><div class=fn>int <a href="#bottom-prop"><b>bottom</b></a>&nbsp;- the validator's lowest acceptable value</div></li>
<li><div class=fn>int <a href="#top-prop"><b>top</b></a>&nbsp;- the validator's highest acceptable value</div></li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>


<p> The QIntValidator class provides a validator which ensures that
a string contains a valid integer within a specified range.
<p> 
<p> The <a href="#validate">validate</a>() function returns <a href="qvalidator.html#State-enum">Acceptable</a>, <a href="qvalidator.html#State-enum">Intermediate</a> or <a href="qvalidator.html#State-enum">Invalid</a>. <a href="qvalidator.html#State-enum">Acceptable</a> means that the string is a valid integer within
the specified range. <a href="qvalidator.html#State-enum">Intermediate</a> means that the string is a valid
integer but is not within the specified range. <a href="qvalidator.html#State-enum">Invalid</a> means that
the string is not a valid integer.
<p> Example of use:
<p> <pre>
    QIntValidator v( 0, 100, this );
    <a href="qlineedit.html">QLineEdit</a>* edit = new <a href="qlineedit.html">QLineEdit</a>( this );

    // the edit lineedit will only accept integers between 0 and 100
    edit-&gt;<a href="qlineedit.html#setValidator">setValidator</a>( &amp;v );
  </pre>
 
<p> Below we present some examples of validators. In practice they would
normally be associated with a widget as in the example above.
<p> <pre>
    <a href="qstring.html">QString</a> s;
    QIntValidator v( 0, 100, this );

    s = "10";
    v.<a href="#validate">validate</a>( s, 0 ); // returns Acceptable
    s = "35";
    v.<a href="#validate">validate</a>( s, 0 ); // returns Acceptable

    s = "105";
    v.<a href="#validate">validate</a>( s, 0 ); // returns Intermediate

    s = "-763";
    v.<a href="#validate">validate</a>( s, 0 ); // returns Invalid
    s = "abc";
    v.<a href="#validate">validate</a>( s, 0 ); // returns Invalid
    s = "12v";
    v.<a href="#validate">validate</a>( s, 0 ); // returns Invalid
  </pre>
 
<p> The minimum and maximum values are set in one call with <a href="#setRange">setRange</a>() or
individually with <a href="#setBottom">setBottom</a>() and <a href="#setTop">setTop</a>().
<p> <p>See also <a href="qdoublevalidator.html">QDoubleValidator</a>, <a href="qregexpvalidator.html">QRegExpValidator</a> and <a href="misc.html">Miscellaneous Classes</a>.

<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="QIntValidator"></a>QIntValidator::QIntValidator ( <a href="qobject.html">QObject</a>&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0 )
</h3>
Constructs a validator that accepts all integers and has parent
<em>parent</em> and name <em>name</em>.

<h3 class=fn><a name="QIntValidator-2"></a>QIntValidator::QIntValidator ( int&nbsp;minimum, int&nbsp;maximum, <a href="qobject.html">QObject</a>&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0 )
</h3>
Constructs a validator that accepts all integers from and including <em>minimum</em> up to and including <em>maximum</em> with parent <em>parent</em> and
name <em>name</em>.

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

<h3 class=fn>int <a name="bottom"></a>QIntValidator::bottom () const
</h3><p>Returns the validator's lowest acceptable value.
See the <a href="qintvalidator.html#bottom-prop">"bottom"</a> property for details.
<h3 class=fn>void <a name="setBottom"></a>QIntValidator::setBottom ( int )
</h3><p>Sets the validator's lowest acceptable value.
See the <a href="qintvalidator.html#bottom-prop">"bottom"</a> property for details.
<h3 class=fn>void <a name="setRange"></a>QIntValidator::setRange ( int&nbsp;minimum, int&nbsp;maximum )<tt> [virtual]</tt>
</h3>
Sets the range of the validator to accept only integers between <em>minimum</em> and
<em>maximum</em> inclusive.

<h3 class=fn>void <a name="setTop"></a>QIntValidator::setTop ( int )
</h3><p>Sets the validator's highest acceptable value.
See the <a href="qintvalidator.html#top-prop">"top"</a> property for details.
<h3 class=fn>int <a name="top"></a>QIntValidator::top () const
</h3><p>Returns the validator's highest acceptable value.
See the <a href="qintvalidator.html#top-prop">"top"</a> property for details.
<h3 class=fn><a href="qvalidator.html#State-enum">QValidator::State</a> <a name="validate"></a>QIntValidator::validate ( <a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;input, int &amp; ) const<tt> [virtual]</tt>
</h3>
Returns <a href="qvalidator.html#State-enum">Acceptable</a> if the <em>input</em> is an integer within the valid
range, <a href="qvalidator.html#State-enum">Intermediate</a> if the <em>input</em> is an integer outside the
valid range and <a href="qvalidator.html#State-enum">Invalid</a> if the <em>input</em> is not an integer.
<p> <pre>
    s = "35";
    v.validate( s, 0 ); // returns Acceptable

    s = "105";
    v.validate( s, 0 ); // returns Intermediate

    s = "abc";
    v.validate( s, 0 ); // returns Invalid
  </pre>
 

<p>Reimplemented from <a href="qvalidator.html#validate">QValidator</a>.
<hr><h2>Property Documentation</h2>
<h3 class=fn>int <a name="bottom-prop"></a>bottom</h3> <p>This property holds the validator's lowest 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="top-prop"></a>top</h3> <p>This property holds the validator's highest 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">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 &copy; 2001 
<a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align=right><div align=right>Qt version 3.0.2</div>
</table></div></address></body>
</html>