QDoubleValidator(3qt)
π QDoubleValidator π
okay bestie, so this is the manual page for QDoubleValidator from the 3qt manual β yes that's the Qt 3 era, we're going vintage, and it's still iconic. She's a validator. She checks your floating-point numbers. She's giving bouncer-at-the-club energy but for decimals. π
β¨ NAME β¨
QDoubleValidator β range checking of floating-point numbers
No cap, that's literally her whole job description and she ate. π
πΈ SYNOPSIS πΈ
#include <qvalidator.h>
Inherits QValidator.
π¦ Public Members π¦
QDoubleValidator ( QObject * parent, const char * name = 0 )
QDoubleValidator ( double bottom, double top, int decimals, QObject *
parent, const char * name = 0 )
~QDoubleValidator ()
virtual QValidator::State validate ( QString & input, int & ) const
virtual void setRange ( double minimum, double maximum, int decimals = 0
)
void setBottom ( double )
void setTop ( double )
void setDecimals ( int )
double bottom () const
double top () const
int decimals () const
π§ Properties π§
double bottomβ the validator's minimum acceptable valueint decimalsβ the validator's maximum number of digits after the decimal pointdouble topβ the validator's maximum acceptable value
π DESCRIPTION π
The QDoubleValidator class provides range checking of floating-point numbers. Periodt.
So here's the tea: QDoubleValidator gives you an upper bound, a lower bound, and a limit on the number of digits after the decimal point. What she does not do β and this is important, bestie, write it down β is provide a fixup() function. She's a validator, not a fixer. She tells you what's wrong, she does not clean it up for you. π
You can set the acceptable range in one single call with setRange(), or you can do it the long way with setBottom() and setTop(). Set the number of decimal places with setDecimals(). And the validate() function returns the validation state β that's the vibe check right there.
See also QIntValidator, QRegExpValidator, and Miscellaneous Classes. π
π MEMBER FUNCTION DOCUMENTATION π
QDoubleValidator::QDoubleValidator ( QObject * parent, const char * name = 0 )
Constructs a validator object with parent parent, called name, which accepts any double. She's unbothered. She's open-minded. She says yes to everything. π
QDoubleValidator::QDoubleValidator ( double bottom, double top, int decimals, QObject * parent, const char * name = 0 )
Constructs a validator object with parent parent, called name. This validator will accept doubles from bottom to top inclusive, with up to decimals digits after the decimal point.
So now she has β¨boundariesβ¨. Good for her honestly. π«Ά
QDoubleValidator::~QDoubleValidator ()
Destroys the validator, freeing any resources used. It's giving closure. She's moving on. π
double QDoubleValidator::bottom () const
Returns the validator's minimum acceptable value. See the "bottom" property for details.
int QDoubleValidator::decimals () const
Returns the validator's maximum number of digits after the decimal point. See the "decimals" property for details.
void QDoubleValidator::setBottom ( double )
Sets the validator's minimum acceptable value. See the "bottom" property for details.
void QDoubleValidator::setDecimals ( int )
Sets the validator's maximum number of digits after the decimal point. See the "decimals" property for details.
void QDoubleValidator::setRange ( double minimum, double maximum, int decimals = 0 ) [virtual]
Sets the validator to accept doubles from minimum to maximum inclusive, with at most decimals digits after the decimal point.
One call, whole range set. Main character efficiency. π
void QDoubleValidator::setTop ( double )
Sets the validator's maximum acceptable value. See the "top" property for details.
double QDoubleValidator::top () const
Returns the validator's maximum acceptable value. See the "top" property for details.
QValidator::State QDoubleValidator::validate ( QString & input, int & ) const [virtual]
Okay this is the big one, bestie, pay attention. π₯
Returns Acceptable if the string input contains a double that is within the valid range and is in the correct format. Slay, she passed the vibe check. β
Returns Intermediate if input 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. Likeβ¦ she's not mad, she's just disappointed. Kinda. π
Returns Invalid if the input is not a double. Straight up no. Not even close. π
Note: If the valid range consists of just positive doubles (e.g.0.0-100.0) and input is a negative double then Invalid is returned. She said positive only, and she meant it. Do not test her. β
Reimplemented from QValidator.
π Property Documentation π
double bottom
This property holds the validator's minimum acceptable value.
Set this property's value with setBottom() and get this property's value with bottom().
See also setRange().
int decimals
This property holds the validator's maximum number of digits after the decimal point.
Set this property's value with setDecimals() and get this property's value with decimals().
See also setRange().
double top
This property holds the validator's maximum acceptable value.
Set this property's value with setTop() and get this property's value with top().
See also setRange().
π¦ SEE ALSO π¦
Go read the docs, bestie, they're free. π
πΈ COPYRIGHT πΈ
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.
π§ AUTHOR π§
Generated automatically from the source code.
(So technically the author is a script. Respect the script honestly, she's doing her best. π)
π BUGS π
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you.
ngl, good bug reports are a love language. Write them properly and the maintainers will literally adore you. π«Ά
The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech.
So likeβ¦ this man page is the side quest, not the main quest. The HTML is canon. Just so you know. β¨
If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qdoublevalidator.3qt) and the Qt version (3.3.8).
Include the page name AND the version or they can't help you, bestie, that's the rule. π
okay that's the whole page, you made it, I'm so proud of you, go validate some doubles responsibly ππβ¨
Trolltech AS β 2 February 2007 β Qt version 3.3.8 β and yes, she's old, but she's iconic and she still works. periodt. π π
π¦ where this page comes from
- fedora 43: qt3-devel-docs 3.3.8b-102.fc43 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- fedora 44: qt3-devel-docs 3.3.8b-103.fc44 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms