Skip to content
Permalink
Browse files

Show an empty string if precision is 0 or not valid

Backported from master
  • Loading branch information
elpaso committed Oct 29, 2018
1 parent 344a5a6 commit 24eaea5eeac4af2b19b3ef040f3c7aaba15853e4
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/app/qgsvectorlayerproperties.cpp
@@ -408,11 +408,12 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
mGeometryPrecisionLineEdit->setValidator( new QDoubleValidator( mGeometryPrecisionLineEdit ) );

mRemoveDuplicateNodesCheckbox->setChecked( mLayer->geometryOptions()->removeDuplicateNodes() );
double precision( mLayer->geometryOptions()->geometryPrecision() );
bool ok = true;
QString precision( QLocale().toString( mLayer->geometryOptions()->geometryPrecision(), ok ) );
if ( ! ok )
precision = 0.0;
mGeometryPrecisionLineEdit->setText( precision );
QString precisionStr( QLocale().toString( precision, ok ) );
if ( precision == 0.0 || ! ok )
precisionStr = QString();
mGeometryPrecisionLineEdit->setText( precisionStr );

mPrecisionUnitsLabel->setText( QStringLiteral( "[%1]" ).arg( QgsUnitTypes::toAbbreviatedString( mLayer->crs().mapUnits() ) ) );

0 comments on commit 24eaea5

Please sign in to comment.
You can’t perform that action at this time.