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