Navigation Menu

Skip to content

Commit

Permalink
Fix enabling field length parameter in New Memory Layer dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
agiudiceandrea authored and nyalldawson committed Apr 6, 2023
1 parent f499307 commit 03188dd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/gui/qgsnewmemorylayerdialog.cpp
Expand Up @@ -160,13 +160,15 @@ void QgsNewMemoryLayerDialog::mTypeBox_currentIndexChanged( int index )
mPrecision->clear();
mPrecision->setEnabled( false );
mWidth->setValidator( new QIntValidator( 1, 255, this ) );
mWidth->setEnabled( true );
break;
case 1: // Whole number
if ( mWidth->text().toInt() < 1 || mWidth->text().toInt() > 10 )
mWidth->setText( QStringLiteral( "10" ) );
mPrecision->clear();
mPrecision->setEnabled( false );
mWidth->setValidator( new QIntValidator( 1, 10, this ) );
mWidth->setEnabled( true );
break;
case 2: // Decimal number
if ( mWidth->text().toInt() < 1 || mWidth->text().toInt() > 30 )
Expand All @@ -175,6 +177,7 @@ void QgsNewMemoryLayerDialog::mTypeBox_currentIndexChanged( int index )
mPrecision->setText( QStringLiteral( "6" ) );
mPrecision->setEnabled( true );
mWidth->setValidator( new QIntValidator( 1, 20, this ) );
mWidth->setEnabled( true );
break;
case 3: // Boolean
mWidth->clear();
Expand Down

0 comments on commit 03188dd

Please sign in to comment.