Classes - Annotated - Tree - Functions - Home - Structure

QDoubleValidator Class Reference

The QDoubleValidator class provides range checking of floating-point numbers. More...

#include <qvalidator.h>

Inherits QValidator.

List of all member functions.

Public Members

Properties


Detailed Description

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.

See also QIntValidator and QRegExpValidator.


Member Function Documentation

QDoubleValidator::QDoubleValidator ( QWidget * parent, const char * name = 0 )

Constructs a validator object which accepts all doubles.

QDoubleValidator::QDoubleValidator ( double bottom, double top, int decimals, QWidget * parent, const char * name = 0 )

Constructs a validator object which accepts all doubles from bottom up to and including top with at most decimals digits after the decimal point.

QDoubleValidator::~QDoubleValidator ()

Destroys the validator, freeing any storage and other resources used.

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 numbers from minimum up to and including maximum with at most decimals digits after the decimal point.

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]

Returns Acceptable if input contains a number that is within the valid range and is in the correct format; Intermediate if it contains a number that is outside the range or is in the wrong format, e.g. with too many digits after the decimal point or is empty; and Invalid if the input is not a number.

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().


Search the documentation, FAQ, qt-interest archive and more (uses www.trolltech.com):


This file is part of the Qt toolkit, copyright © 1995-2000 Trolltech, all rights reserved.


Copyright © 2000 TrolltechTrademarks
Qt version main-beta1