Skip to content
Permalink
Browse files

Use validator for nodata line edit

git-svn-id: http://svn.osgeo.org/qgis/trunk@14610 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Nov 13, 2010
1 parent 9994ae4 commit 8b6b79925ed51563fab2dc79ac35f647e600336a
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/app/qgsrasterlayerproperties.cpp
@@ -111,6 +111,7 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer* lyr, QgsMapCanv
leMinimumScale->setValidator( new QDoubleValidator( 0, std::numeric_limits<float>::max(), 1000, this ) );
leMaximumScale->setText( QString::number( lyr->maximumScale(), 'f' ) );
leMaximumScale->setValidator( new QDoubleValidator( 0, std::numeric_limits<float>::max(), 1000, this ) );
leNoDataValue->setValidator( new QDoubleValidator( -std::numeric_limits<float>::max(), std::numeric_limits<float>::max(), 1000, this ) );

// build GUI components
cboxColorMap->addItem( tr( "Grayscale" ) );
@@ -771,11 +772,11 @@ void QgsRasterLayerProperties::sync()
//add current NoDataValue to NoDataValue line edit
if ( mRasterLayer->isNoDataValueValid() )
{
leNoDataValue->setText( QString::number( mRasterLayer->noDataValue(), 'f' ) );
leNoDataValue->insert( QString::number( mRasterLayer->noDataValue(), 'f' ) );
}
else
{
leNoDataValue->setText( "" );
leNoDataValue->insert( "" );
}

//restore colormap tab if the layer has custom classification
@@ -1176,11 +1177,11 @@ void QgsRasterLayerProperties::apply()
mRasterLayer->resetNoDataValue();
if ( mRasterLayer->isNoDataValueValid() )
{
leNoDataValue->setText( QString::number( mRasterLayer->noDataValue(), 'f' ) );
leNoDataValue->insert( QString::number( mRasterLayer->noDataValue(), 'f' ) );
}
else
{
leNoDataValue->setText( "" );
leNoDataValue->clear();
}
chkboxResetNoDataValue->setChecked( false );
}

0 comments on commit 8b6b799

Please sign in to comment.
You can’t perform that action at this time.