@@ -111,6 +111,7 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer* lyr, QgsMapCanv
111
111
leMinimumScale->setValidator ( new QDoubleValidator ( 0 , std::numeric_limits<float >::max (), 1000 , this ) );
112
112
leMaximumScale->setText ( QString::number ( lyr->maximumScale (), ' f' ) );
113
113
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 ) );
114
115
115
116
// build GUI components
116
117
cboxColorMap->addItem ( tr ( " Grayscale" ) );
@@ -771,11 +772,11 @@ void QgsRasterLayerProperties::sync()
771
772
// add current NoDataValue to NoDataValue line edit
772
773
if ( mRasterLayer ->isNoDataValueValid () )
773
774
{
774
- leNoDataValue->setText ( QString::number ( mRasterLayer ->noDataValue (), ' f' ) );
775
+ leNoDataValue->insert ( QString::number ( mRasterLayer ->noDataValue (), ' f' ) );
775
776
}
776
777
else
777
778
{
778
- leNoDataValue->setText ( " " );
779
+ leNoDataValue->insert ( " " );
779
780
}
780
781
781
782
// restore colormap tab if the layer has custom classification
@@ -1176,11 +1177,11 @@ void QgsRasterLayerProperties::apply()
1176
1177
mRasterLayer ->resetNoDataValue ();
1177
1178
if ( mRasterLayer ->isNoDataValueValid () )
1178
1179
{
1179
- leNoDataValue->setText ( QString::number ( mRasterLayer ->noDataValue (), ' f' ) );
1180
+ leNoDataValue->insert ( QString::number ( mRasterLayer ->noDataValue (), ' f' ) );
1180
1181
}
1181
1182
else
1182
1183
{
1183
- leNoDataValue->setText ( " " );
1184
+ leNoDataValue->clear ( );
1184
1185
}
1185
1186
chkboxResetNoDataValue->setChecked ( false );
1186
1187
}
0 commit comments