[QGIS Commit] r14610 - trunk/qgis/src/app

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sat Nov 13 12:43:47 EST 2010


Author: mhugent
Date: 2010-11-13 09:43:47 -0800 (Sat, 13 Nov 2010)
New Revision: 14610

Modified:
   trunk/qgis/src/app/qgsrasterlayerproperties.cpp
Log:
Use validator for nodata line edit

Modified: trunk/qgis/src/app/qgsrasterlayerproperties.cpp
===================================================================
--- trunk/qgis/src/app/qgsrasterlayerproperties.cpp	2010-11-13 17:39:42 UTC (rev 14609)
+++ trunk/qgis/src/app/qgsrasterlayerproperties.cpp	2010-11-13 17:43:47 UTC (rev 14610)
@@ -111,6 +111,7 @@
   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 @@
   //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 @@
     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 );
   }



More information about the QGIS-commit mailing list