The QDoubleValidator class provides range checking of floating-point numbers.
Más...
#include <qvalidator.h>
Lista de todos los miembros.
Métodos públicos |
| QDoubleValidator (QObject *parent, const char *name=0) |
| QDoubleValidator (double bottom, double top, int decimals, QObject *parent, const char *name=0) |
| ~QDoubleValidator () |
QValidator::State | validate (QString &, int &) const |
virtual void | setRange (double bottom, double top, int decimals=0) |
void | setBottom (double) |
void | setTop (double) |
void | setDecimals (int) |
double | bottom () const |
double | top () const |
int | decimals () const |
| QDoubleValidator (QObject *parent, const char *name=0) |
| QDoubleValidator (double bottom, double top, int decimals, QObject *parent, const char *name=0) |
| ~QDoubleValidator () |
QValidator::State | validate (QString &, int &) const |
virtual void | setRange (double bottom, double top, int decimals=0) |
void | setBottom (double) |
void | setTop (double) |
void | setDecimals (int) |
double | bottom () const |
double | top () const |
int | decimals () const |
Propiedades |
double | bottom |
| the validator's minimum acceptable value
|
double | top |
| the validator's maximum acceptable value
|
int | decimals |
| the validator's maximum number of digits after the decimal point
|
Descripción detallada
The QDoubleValidator class provides range checking of floating-point numbers.
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 fixup() function.
You can set the acceptable range in one call with setRange(), or with setBottom() and setTop(). Set the number of decimal places with setDecimals(). The validate() function returns the validation state.
- Ver también:
- QIntValidator QRegExpValidator
Documentación del constructor y destructor
QDoubleValidator::QDoubleValidator |
( |
QObject * |
parent, |
|
|
const char * |
name = 0 |
|
) |
| |
Constructs a validator object with parent parent, called name, which accepts any double.
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.
QDoubleValidator::~QDoubleValidator |
( |
| ) |
|
Destroys the validator, freeing any resources used.
QDoubleValidator::QDoubleValidator |
( |
QObject * |
parent, |
|
|
const char * |
name = 0 |
|
) |
| |
QDoubleValidator::QDoubleValidator |
( |
double |
bottom, |
|
|
double |
top, |
|
|
int |
decimals, |
|
|
QObject * |
parent, |
|
|
const char * |
name = 0 |
|
) |
| |
QDoubleValidator::~QDoubleValidator |
( |
| ) |
|
Documentación de las funciones miembro
double QDoubleValidator::bottom |
( |
| ) |
const [inline] |
double QDoubleValidator::bottom |
( |
| ) |
const [inline] |
int QDoubleValidator::decimals |
( |
| ) |
const [inline] |
int QDoubleValidator::decimals |
( |
| ) |
const [inline] |
void QDoubleValidator::setBottom |
( |
double |
| ) |
|
void QDoubleValidator::setBottom |
( |
double |
bottom | ) |
|
void QDoubleValidator::setDecimals |
( |
int |
decimals | ) |
|
void QDoubleValidator::setDecimals |
( |
int |
| ) |
|
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.
virtual void QDoubleValidator::setRange |
( |
double |
bottom, |
|
|
double |
top, |
|
|
int |
decimals = 0 |
|
) |
| [virtual] |
void QDoubleValidator::setTop |
( |
double |
top | ) |
|
void QDoubleValidator::setTop |
( |
double |
| ) |
|
double QDoubleValidator::top |
( |
void |
| ) |
const [inline] |
double QDoubleValidator::top |
( |
void |
| ) |
const [inline] |
Returns Acceptable
if the string input contains a double that is within the valid range and is in the correct format.
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.
Returns Invalid
if the input is not a double.
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.
Implementa QValidator.
Reimplementado en FLDoubleValidator.
This pure virtual function returns Invalid
if input is invalid according to this validator's rules, Intermediate
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 Acceptable
if the input is valid.
The function can change input and pos (the cursor position) if it wants to.
Implementa QValidator.
Reimplementado en FLDoubleValidator.
Documentación de propiedades
double QDoubleValidator::bottom [read, write] |
the validator's minimum acceptable value
- Ver también:
- setRange()
int QDoubleValidator::decimals [read, write] |
the validator's maximum number of digits after the decimal point
- Ver también:
- setRange()
double QDoubleValidator::top [read, write] |
the validator's maximum acceptable value
- Ver también:
- setRange()
La documentación para esta clase fue generada a partir de los siguientes ficheros: