File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -408,7 +408,12 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
408
408
mGeometryPrecisionLineEdit ->setValidator ( new QDoubleValidator ( mGeometryPrecisionLineEdit ) );
409
409
410
410
mRemoveDuplicateNodesCheckbox ->setChecked ( mLayer ->geometryOptions ()->removeDuplicateNodes () );
411
- mGeometryPrecisionLineEdit ->setText ( QString::number ( mLayer ->geometryOptions ()->geometryPrecision () ) );
411
+ double precision ( mLayer ->geometryOptions ()->geometryPrecision () );
412
+ bool ok = true ;
413
+ QString precisionStr ( QLocale ().toString ( precision, ok ) );
414
+ if ( precision == 0.0 || ! ok )
415
+ precisionStr = QString ();
416
+ mGeometryPrecisionLineEdit ->setText ( precisionStr );
412
417
413
418
mPrecisionUnitsLabel ->setText ( QStringLiteral ( " [%1]" ).arg ( QgsUnitTypes::toAbbreviatedString ( mLayer ->crs ().mapUnits () ) ) );
414
419
@@ -782,7 +787,11 @@ void QgsVectorLayerProperties::apply()
782
787
#endif
783
788
784
789
mLayer ->geometryOptions ()->setRemoveDuplicateNodes ( mRemoveDuplicateNodesCheckbox ->isChecked () );
785
- mLayer ->geometryOptions ()->setGeometryPrecision ( mGeometryPrecisionLineEdit ->text ().toDouble () );
790
+ bool ok = true ;
791
+ double precision ( QLocale ().toDouble ( mGeometryPrecisionLineEdit ->text (), &ok ) );
792
+ if ( ! ok )
793
+ precision = 0.0 ;
794
+ mLayer ->geometryOptions ()->setGeometryPrecision ( precision );
786
795
787
796
QStringList activeChecks;
788
797
QHash<QCheckBox *, QString>::const_iterator it;
You can’t perform that action at this time.
0 commit comments