<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qquickvalidator.cpp --> <title>DoubleValidator QML Type | Qt Quick 5.9</title> <link rel="stylesheet" type="text/css" href="style/offline-simple.css" /> <script type="text/javascript"> document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css"); // loading style sheet breaks anchors that were jumped to before // so force jumping to anchor again setTimeout(function() { var anchor = location.hash; // need to jump to different anchor first (e.g. none) location.hash = "#"; setTimeout(function() { location.hash = anchor; }, 0); }, 0); </script> </head> <body> <div class="header" id="qtdocheader"> <div class="main"> <div class="main-rounded"> <div class="navigationbar"> <table><tr> <td >Qt 5.9</td><td ><a href="qtquick-index.html">Qt Quick</a></td><td ><a href="qtquick-qmlmodule.html">QML Types</a></td><td >DoubleValidator QML Type</td></tr></table><table class="buildversion"><tr> <td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td> </tr></table> </div> </div> <div class="content"> <div class="line"> <div class="content mainContent"> <div class="sidebar"> <div class="toc"> <h3><a name="toc">Contents</a></h3> <ul> <li class="level1"><a href="#properties">Properties</a></li> <li class="level1"><a href="#details">Detailed Description</a></li> </ul> </div> <div class="sidebar-content" id="sidebar-content"></div></div> <h1 class="title">DoubleValidator QML Type</h1> <span class="subtitle"></span> <!-- $$$DoubleValidator-brief --> <p>Defines a validator for non-integer numbers <a href="#details">More...</a></p> <!-- @@@DoubleValidator --> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import QtQuick 2.7</td></tr></table></div><ul> <li><a href="qml-qtquick-doublevalidator-members.html">List of all members, including inherited members</a></li> </ul> <a name="properties"></a> <h2 id="properties">Properties</h2> <ul> <li class="fn"><b><b><a href="qml-qtquick-doublevalidator.html#bottom-prop">bottom</a></b></b> : real</li> <li class="fn"><b><b><a href="qml-qtquick-doublevalidator.html#decimals-prop">decimals</a></b></b> : int</li> <li class="fn"><b><b><a href="qml-qtquick-doublevalidator.html#locale-prop">locale</a></b></b> : string</li> <li class="fn"><b><b><a href="qml-qtquick-doublevalidator.html#notation-prop">notation</a></b></b> : enumeration</li> <li class="fn"><b><b><a href="qml-qtquick-doublevalidator.html#top-prop">top</a></b></b> : real</li> </ul> <!-- $$$DoubleValidator-description --> <a name="details"></a> <h2 id="details">Detailed Description</h2> <p>The <a href="qml-qtquick-doublevalidator.html">DoubleValidator</a> type provides a validator for non-integer numbers.</p> <p>Input is accepted if it contains a double that is within the valid range and is in the correct format.</p> <p>Input is accepected but invalid if it 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>Input is rejected if it is not a double.</p> <p>Note: If the valid range consists of just positive doubles (e.g. 0.0 to 100.0) and input is a negative double then it is rejected. If <a href="qml-qtquick-doublevalidator.html#notation-prop">notation</a> is set to <a href="qml-qtquick-doublevalidator.html">DoubleValidator</a>.StandardNotation, and the input contains more digits before the decimal point than a double in the valid range may have, it is also rejected. If <a href="qml-qtquick-doublevalidator.html#notation-prop">notation</a> is <a href="qml-qtquick-doublevalidator.html">DoubleValidator</a>.ScientificNotation, and the input is not in the valid range, it is accecpted but invalid. The value may yet become valid by changing the exponent.</p> <!-- @@@DoubleValidator --> <h2>Property Documentation</h2> <!-- $$$bottom --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="bottom-prop"> <td class="tblQmlPropNode"><p> <a name="bottom-prop"></a><span class="name">bottom</span> : <span class="type">real</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property holds the validator's minimum acceptable value. By default, this property contains a value of -infinity.</p> </div></div><!-- @@@bottom --> <br/> <!-- $$$decimals --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="decimals-prop"> <td class="tblQmlPropNode"><p> <a name="decimals-prop"></a><span class="name">decimals</span> : <span class="type">int</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property holds the validator's maximum number of digits after the decimal point. By default, this property contains a value of 1000.</p> </div></div><!-- @@@decimals --> <br/> <!-- $$$locale --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="locale-prop"> <td class="tblQmlPropNode"><p> <a name="locale-prop"></a><span class="name">locale</span> : <span class="type">string</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property holds the name of the locale used to interpret the number.</p> <p><b>See also </b>Qt.locale().</p> </div></div><!-- @@@locale --> <br/> <!-- $$$notation --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="notation-prop"> <td class="tblQmlPropNode"><p> <a name="notation-prop"></a><span class="name">notation</span> : <span class="type">enumeration</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property holds the notation of how a string can describe a number.</p> <p>The possible values for this property are:</p> <ul> <li><a href="qml-qtquick-doublevalidator.html">DoubleValidator</a>.StandardNotation</li> <li><a href="qml-qtquick-doublevalidator.html">DoubleValidator</a>.ScientificNotation (default)</li> </ul> <p>If this property is set to <a href="qml-qtquick-doublevalidator.html">DoubleValidator</a>.ScientificNotation, the written number may have an exponent part (e.g. 1.5E-2).</p> </div></div><!-- @@@notation --> <br/> <!-- $$$top --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="top-prop"> <td class="tblQmlPropNode"><p> <a name="top-prop"></a><span class="name">top</span> : <span class="type">real</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property holds the validator's maximum acceptable value. By default, this property contains a value of infinity.</p> </div></div><!-- @@@top --> <br/> </div> </div> </div> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2017 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.<br> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br> Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. </p> </div> </body> </html>