Skip to content
Permalink
Browse files

Show an empty string if precision is 0 or not valid

  • Loading branch information
elpaso committed Oct 29, 2018
1 parent 12c75d3 commit ac54e9611be50cbf82183027d34440001db6dfc8
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 ac54e96

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