Skip to content
Permalink
Browse files

Merge pull request #8358 from elpaso/bugfix-20255

Fix geometry precision input in vector layer properties and not-dot l…
  • Loading branch information
elpaso committed Oct 29, 2018
2 parents 8fc4378 + ac54e96 commit b00b3f68fc2f19cc87f18995a2a258e3304a9249
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 b00b3f6

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