File: qdoublevalidator.html

package info (click to toggle)
python-qt4 4.7.3-1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 28,504 kB
  • ctags: 4,680
  • sloc: python: 28,738; cpp: 8,897; sh: 245; xml: 243; makefile: 150
file content (34 lines) | stat: -rw-r--r-- 9,516 bytes parent folder | download
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
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QDoubleValidator Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QDoubleValidator Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QDoubleValidator class provides range checking of floating-point numbers. <a href="#details">More...</a></p>
<p>Inherits <a href="qvalidator.html">QValidator</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qdoublevalidator.html#Notation-enum">Notation</a></b> { StandardNotation, ScientificNotation }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qdoublevalidator.html#QDoubleValidator">__init__</a></b> (<i>self</i>, QObject)</li><li><div class="fn" /><b><a href="qdoublevalidator.html#QDoubleValidator-2">__init__</a></b> (<i>self</i>, float, float, int, QObject)</li><li><div class="fn" />float <b><a href="qdoublevalidator.html#bottom">bottom</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qdoublevalidator.html#decimals">decimals</a></b> (<i>self</i>)</li><li><div class="fn" />Notation <b><a href="qdoublevalidator.html#notation">notation</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdoublevalidator.html#setBottom">setBottom</a></b> (<i>self</i>, float)</li><li><div class="fn" /><b><a href="qdoublevalidator.html#setDecimals">setDecimals</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qdoublevalidator.html#setNotation">setNotation</a></b> (<i>self</i>, Notation)</li><li><div class="fn" /><b><a href="qdoublevalidator.html#setRange">setRange</a></b> (<i>self</i>, float, float, int&#160;<i>decimals</i>&#160;=&#160;0)</li><li><div class="fn" /><b><a href="qdoublevalidator.html#setTop">setTop</a></b> (<i>self</i>, float)</li><li><div class="fn" />float <b><a href="qdoublevalidator.html#top">top</a></b> (<i>self</i>)</li><li><div class="fn" />(QValidator.State, QString, int) <b><a href="qdoublevalidator.html#validate">validate</a></b> (<i>self</i>, QString, int)</li><li><div class="fn" />(QValidator.State, int) <b><a href="qdoublevalidator.html#validate-2">validate</a></b> (<i>self</i>, QString, int)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QDoubleValidator class provides range checking of floating-point numbers.</p>
<p>QDoubleValidator 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="qvalidator.html#fixup">fixup</a>() function.</p>
<p>You can set the acceptable range in one call with <a href="qdoublevalidator.html#setRange">setRange</a>(), or with <a href="qdoublevalidator.html#bottom-prop">setBottom</a>() and <a href="qdoublevalidator.html#top-prop">setTop</a>(). Set the number of decimal places with <a href="qdoublevalidator.html#decimals-prop">setDecimals</a>(). The <a href="qdoublevalidator.html#validate">validate</a>() function returns the validation state.</p>
<p>QDoubleValidator uses its <a href="qvalidator.html#locale">locale</a>() to interpret the number. For example, in the German locale, "1,234" will be accepted as the fractional number 1.234. In Arabic locales, QDoubleValidator will accept Arabic digits.</p>
<p>In addition, QDoubleValidator is always guaranteed to accept a number formatted according to the "C" locale. QDoubleValidator will not accept numbers with thousand-seperators.</p>
<p>See also <a href="qintvalidator.html">QIntValidator</a>, <a href="qregexpvalidator.html">QRegExpValidator</a>, and <a href="widgets-lineedits.html">Line Edits Example</a>.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="Notation-enum" />QDoubleValidator.Notation</h3><p>This enum defines the allowed notations for entering a double.</p>
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QDoubleValidator.StandardNotation</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">The string is written as a standard number (i.e. 0.015).</td></tr>
<tr><td valign="top"><tt>QDoubleValidator.ScientificNotation</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">The string is written in scientific form. It may have an exponent part(i.e. 1.5E-2).</td></tr>
</table></p>
<p>This enum was introduced in Qt 4.3.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QDoubleValidator" />QDoubleValidator.__init__ (<i>self</i>, <a href="qobject.html">QObject</a>)</h3><p>The <i>QObject</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a validator object with a <i>parent</i> object that accepts any double.</p>
<h3 class="fn"><a name="QDoubleValidator-2" />QDoubleValidator.__init__ (<i>self</i>, float, float, int, <a href="qobject.html">QObject</a>)</h3><p>The <i>QObject</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a validator object with a <i>parent</i> object. This validator will accept doubles from <i>bottom</i> to <i>top</i> inclusive, with up to <i>decimals</i> digits after the decimal point.</p>
<a name="//apple_ref/cpp/instm/QDoubleValidator/~QDoubleValidator" />
<h3 class="fn"><a name="bottom" />float QDoubleValidator.bottom (<i>self</i>)</h3><h3 class="fn"><a name="decimals" />int QDoubleValidator.decimals (<i>self</i>)</h3><h3 class="fn"><a name="notation" /><a href="qdoublevalidator.html#Notation-enum">Notation</a> QDoubleValidator.notation (<i>self</i>)</h3><h3 class="fn"><a name="setBottom" />QDoubleValidator.setBottom (<i>self</i>, float)</h3><h3 class="fn"><a name="setDecimals" />QDoubleValidator.setDecimals (<i>self</i>, int)</h3><h3 class="fn"><a name="setNotation" />QDoubleValidator.setNotation (<i>self</i>, <a href="qdoublevalidator.html#Notation-enum">Notation</a>)</h3><h3 class="fn"><a name="setRange" />QDoubleValidator.setRange (<i>self</i>, float, float, int&#160;<i>decimals</i>&#160;=&#160;0)</h3><p>Sets the validator to accept doubles from <i>minimum</i> to <i>maximum</i> inclusive, with at most <i>decimals</i> digits after the decimal point.</p>
<a name="//apple_ref/cpp/instm/QDoubleValidator/validate" />
<h3 class="fn"><a name="setTop" />QDoubleValidator.setTop (<i>self</i>, float)</h3><h3 class="fn"><a name="top" />float QDoubleValidator.top (<i>self</i>)</h3><h3 class="fn"><a name="validate" />(<a href="qvalidator.html#State-enum">QValidator.State</a>, QString, int) QDoubleValidator.validate (<i>self</i>, QString, int)</h3><p>Reimplemented from <a href="qvalidator.html#validate">QValidator.validate</a>().</p>
<p>Returns <a href="qvalidator.html#State-enum">Acceptable</a> if the string <i>input</i> contains a double that is within the valid range and is in the correct format.</p>
<p>Returns <a href="qvalidator.html#State-enum">Intermediate</a> if <i>input</i> 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>
<p>Returns <a href="qvalidator.html#State-enum">Invalid</a> if the <i>input</i> is not a double.</p>
<p>Note: If the valid range consists of just positive doubles (e.g. 0.0 to 100.0) and <i>input</i> is a negative double then <a href="qvalidator.html#State-enum">Invalid</a> is returned. If <a href="qdoublevalidator.html#notation-prop">notation</a>() is set to <a href="qdoublevalidator.html#Notation-enum">StandardNotation</a>, and the input contains more digits before the decimal point than a double in the valid range may have, <a href="qvalidator.html#State-enum">Invalid</a> is returned. If <a href="qdoublevalidator.html#notation-prop">notation</a>() is <a href="qdoublevalidator.html#Notation-enum">ScientificNotation</a>, and the input is not in the valid range, <a href="qvalidator.html#State-enum">Intermediate</a> is returned. The value may yet become valid by changing the exponent.</p>
<p>By default, the <i>pos</i> parameter is not used by this validator.</p>
<p /><h3 class="fn"><a name="validate-2" />(<a href="qvalidator.html#State-enum">QValidator.State</a>, int) QDoubleValidator.validate (<i>self</i>, QString, int)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.7.3 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt&#160;4.6.2</td></tr></table></div></address></body></html>