Skip to content

Commit

Permalink
Use validator for nodata line edit
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14610 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Nov 13, 2010
1 parent d9228d1 commit d51e6fc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/app/qgsrasterlayerproperties.cpp
Expand Up @@ -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" ) );
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 );
}
Expand Down

0 comments on commit d51e6fc

Please sign in to comment.