A validator for string values.
More...
#include <QDS_Validator.h>
This class provides validation of the strings entered by the user for datum with 'String' value type according to datum properties: format, filter.
Inherits from QValidator.
QDS_StringValidator::QDS_StringValidator |
( |
QObject * |
p = 0 | ) |
|
Create empty validator object.
- Parameters
-
QDS_StringValidator::QDS_StringValidator |
( |
const QString & |
f, |
|
|
QObject * |
p = 0 |
|
) |
| |
Create validator object with filter string f.
- Parameters
-
f | filter string |
p | parent object |
QDS_StringValidator::QDS_StringValidator |
( |
const QString & |
ft, |
|
|
const QString & |
fg, |
|
|
QObject * |
p = 0 |
|
) |
| |
Create validator object with filter string ft and format flags fg.
- Parameters
-
ft | filter string |
fg | format string |
p | parent object |
QDS_StringValidator::~QDS_StringValidator |
( |
| ) |
|
|
virtual |
int QDS_StringValidator::length |
( |
| ) |
const |
If maximum length is not specified, -1 is returned.
- Returns
- maximum string length
References myLen.
void QDS_StringValidator::setLength |
( |
const int |
l | ) |
|
If l <= 0 is not specified, maximum valid length is reset (any string length is valid).
- Parameters
-
References myLen.
QValidator::State QDS_StringValidator::validate |
( |
QString & |
input, |
|
|
int & |
pos |
|
) |
| const |
|
virtual |
Reimplemented from QValidator.
Convert specified string to the upper/lower case if the format flags contains specificator 'u'/'l' correspondingly. If valid string length is specified, then check given string length. If filter is specified, then perform also 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.
- Parameters
-
input | string being validated |
pos | cursor position |
- Returns
- validation state (
QValidator::State
)
References myFilter, myFlags, and myLen.
QString QDS_StringValidator::myFilter |
|
private |
QString QDS_StringValidator::myFlags |
|
private |
int QDS_StringValidator::myLen |
|
private |
The documentation for this class was generated from the following files: