Skip to content
Permalink
Browse files

Merge pull request #8379 from elpaso/backport-3_4

Backport: Fix geometry precision input in vector layer properties and not-dot
  • Loading branch information
elpaso committed Oct 30, 2018
2 parents 06b4483 + 24eaea5 commit 2ca28f3db1b8796b18bff76fc08ee85e00fa45e3
Showing with 11 additions and 2 deletions.
  1. +11 −2 src/app/qgsvectorlayerproperties.cpp
@@ -408,7 +408,12 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
mGeometryPrecisionLineEdit->setValidator( new QDoubleValidator( mGeometryPrecisionLineEdit ) );

mRemoveDuplicateNodesCheckbox->setChecked( mLayer->geometryOptions()->removeDuplicateNodes() );
mGeometryPrecisionLineEdit->setText( QString::number( mLayer->geometryOptions()->geometryPrecision() ) );
double precision( mLayer->geometryOptions()->geometryPrecision() );
bool ok = true;
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() ) ) );

@@ -782,7 +787,11 @@ void QgsVectorLayerProperties::apply()
#endif

mLayer->geometryOptions()->setRemoveDuplicateNodes( mRemoveDuplicateNodesCheckbox->isChecked() );
mLayer->geometryOptions()->setGeometryPrecision( mGeometryPrecisionLineEdit->text().toDouble() );
bool ok = true;
double precision( QLocale().toDouble( mGeometryPrecisionLineEdit->text(), &ok ) );
if ( ! ok )
precision = 0.0;
mLayer->geometryOptions()->setGeometryPrecision( precision );

QStringList activeChecks;
QHash<QCheckBox *, QString>::const_iterator it;

0 comments on commit 2ca28f3

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