23 #include <QRegExpValidator>
33 : QValidator( parent )
35 , mDateFormat( dateFormat )
43 QString re = QString(
"-?\\d{0,%1}" ).arg(
mField.
length() );
44 mValidator =
new QRegExpValidator( QRegExp( re ), parent );
53 case QVariant::Double:
58 mValidator =
new QRegExpValidator( QRegExp( re ), parent );
62 QString re = QString(
"-?\\d{0,%1}" ).arg(
mField.
length() );
63 mValidator =
new QRegExpValidator( QRegExp( re ), parent );
67 QString re = QString(
"-?\\d*(\\.\\d{0,%1})?" ).arg(
mField.
precision() );
68 mValidator =
new QRegExpValidator( QRegExp( re ), parent );
77 case QVariant::LongLong :
86 mNullValue = settings.value(
"qgis/nullValue",
"NULL" ).toString();
111 QValidator::State result =
mValidator->validate( s, i );
132 return QDate::fromString( s,
mDateFormat ).isValid() ? Acceptable : Intermediate;