Skip to content

Commit 587b338

Browse files
committed
fix #5203
1 parent 55290d0 commit 587b338

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/gui/qgsfieldvalidator.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ QgsFieldValidator::QgsFieldValidator( QObject *parent, const QgsField &field )
5656
QString re = QString( "-?\\d{0,%1}(\\.\\d{0,%2})?" ).arg( mField.length() - mField.precision() ).arg( mField.precision() );
5757
mValidator = new QRegExpValidator( QRegExp( re ), parent );
5858
}
59+
else if ( mField.length() > 0 && mField.precision() == 0 )
60+
{
61+
QString re = QString( "-?\\d{0,%1}" ).arg( mField.length() );
62+
mValidator = new QRegExpValidator( QRegExp( re ), parent );
63+
}
5964
else if ( mField.precision() > 0 )
6065
{
6166
QString re = QString( "-?\\d*(\\.\\d{0,%1})?" ).arg( mField.precision() );

0 commit comments

Comments
 (0)