Back to index

salome-gui  6.5.0
Public Member Functions | Private Attributes
QDS_DoubleValidator Class Reference

A validator for floating point values. More...

#include <QDS_Validator.h>

List of all members.

Public Member Functions

 QDS_DoubleValidator (QObject *p=0)
 QDS_DoubleValidator (const QString &f, QObject *p=0)
virtual ~QDS_DoubleValidator ()
virtual State validate (QString &, int &) const
 Validate the entered string input.

Private Attributes

QString myFilter
 string filter

Detailed Description

A validator for floating point values.

This class provides validation of the strings entered by the user for datum with 'Float' value type according to datum properties: minimum value, maximum value, precision, filter.

Inherits QDoubleValidator.

Definition at line 43 of file QDS_Validator.h.

Constructor & Destructor Documentation


Create empty validator object.

pparent object

Definition at line 114 of file QDS_Validator.cxx.

: QDoubleValidator( p )
QDS_DoubleValidator::QDS_DoubleValidator ( const QString &  f,
QObject p = 0 


Create validator object with filter string f.

ffilter string
pparent object

Definition at line 127 of file QDS_Validator.cxx.

: QDoubleValidator( p ),
  myFilter( f )


Definition at line 136 of file QDS_Validator.cxx.


Member Function Documentation

QValidator::State QDS_DoubleValidator::validate ( QString &  input,
int &  pos 
) const [virtual]

Validate the entered string input.

Reimplemented from QDoubleValidator.

Perform standard check by QDoubleValidator::validate(). If returned state is not QValidator::Invalid and filter is specified then perform validation with filter by QRegExpValidator.

Returns QValidator::Invalid if input is invalid according to this validator's rules, QValidator::Intermediate if it is likely that a little more editing will make the input acceptable and QValidator::Acceptable if the input is valid.

inputstring being validated
poscursor position
validation state (QValidator::State)

Definition at line 157 of file QDS_Validator.cxx.

  State rgState = Acceptable;
  State dvState = QDoubleValidator::validate( input, pos );
  if ( dvState != Invalid && !myFilter.isEmpty() )
    rgState = QRegExpValidator( QRegExp( myFilter ), 0 ).validate( input, pos );

  dvState = qMin( dvState, rgState );

  return dvState;

Member Data Documentation

QString QDS_DoubleValidator::myFilter [private]

string filter

Definition at line 53 of file QDS_Validator.h.

The documentation for this class was generated from the following files: