Skip to content

Commit d51e6fc

Browse files
author
mhugent
committedNov 13, 2010
Use validator for nodata line edit
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14610 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
 

‎src/app/qgsrasterlayerproperties.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer* lyr, QgsMapCanv
111111
leMinimumScale->setValidator( new QDoubleValidator( 0, std::numeric_limits<float>::max(), 1000, this ) );
112112
leMaximumScale->setText( QString::number( lyr->maximumScale(), 'f' ) );
113113
leMaximumScale->setValidator( new QDoubleValidator( 0, std::numeric_limits<float>::max(), 1000, this ) );
114+
leNoDataValue->setValidator( new QDoubleValidator( -std::numeric_limits<float>::max(), std::numeric_limits<float>::max(), 1000, this ) );
114115

115116
// build GUI components
116117
cboxColorMap->addItem( tr( "Grayscale" ) );
@@ -771,11 +772,11 @@ void QgsRasterLayerProperties::sync()
771772
//add current NoDataValue to NoDataValue line edit
772773
if ( mRasterLayer->isNoDataValueValid() )
773774
{
774-
leNoDataValue->setText( QString::number( mRasterLayer->noDataValue(), 'f' ) );
775+
leNoDataValue->insert( QString::number( mRasterLayer->noDataValue(), 'f' ) );
775776
}
776777
else
777778
{
778-
leNoDataValue->setText( "" );
779+
leNoDataValue->insert( "" );
779780
}
780781

781782
//restore colormap tab if the layer has custom classification
@@ -1176,11 +1177,11 @@ void QgsRasterLayerProperties::apply()
11761177
mRasterLayer->resetNoDataValue();
11771178
if ( mRasterLayer->isNoDataValueValid() )
11781179
{
1179-
leNoDataValue->setText( QString::number( mRasterLayer->noDataValue(), 'f' ) );
1180+
leNoDataValue->insert( QString::number( mRasterLayer->noDataValue(), 'f' ) );
11801181
}
11811182
else
11821183
{
1183-
leNoDataValue->setText( "" );
1184+
leNoDataValue->clear();
11841185
}
11851186
chkboxResetNoDataValue->setChecked( false );
11861187
}

0 commit comments

Comments
 (0)
Please sign in to comment.