diff --git a/src/app/qgsgeometryvalidationdock.cpp b/src/app/qgsgeometryvalidationdock.cpp index 2957471ad34..ac4a12a7007 100644 --- a/src/app/qgsgeometryvalidationdock.cpp +++ b/src/app/qgsgeometryvalidationdock.cpp @@ -173,11 +173,16 @@ void QgsGeometryValidationDock::onCurrentErrorChanged( const QModelIndex ¤ mPreviousButton->setEnabled( current.isValid() && current.row() > 0 ); mProblemDetailWidget->setVisible( current.isValid() ); + + if ( !current.isValid() ) + return; + mProblemDescriptionLabel->setText( current.data( QgsGeometryValidationModel::DetailsRole ).toString() ); QgsGeometryCheckError *error = current.data( QgsGeometryValidationModel::GeometryCheckErrorRole ).value(); if ( error ) { + delete mResolutionWidget->layout(); const QStringList resolutionMethods = error->check()->resolutionMethods(); QGridLayout *layout = new QGridLayout( mResolutionWidget ); int resolutionIndex = 0; diff --git a/src/app/qgsgeometryvalidationmodel.cpp b/src/app/qgsgeometryvalidationmodel.cpp index 37c2f7b5c72..58298089272 100644 --- a/src/app/qgsgeometryvalidationmodel.cpp +++ b/src/app/qgsgeometryvalidationmodel.cpp @@ -333,7 +333,8 @@ void QgsGeometryValidationModel::onTopologyErrorUpdated( QgsVectorLayer *layer, if ( layer == mCurrentLayer ) { int i = 0; - for ( const auto ¤tError : qgis::as_const( mTopologyErrorStorage[layer] ) ) + const auto &errors = mTopologyErrorStorage[layer]; + for ( const auto ¤tError : errors ) { if ( currentError.get() == error ) { diff --git a/src/app/qgsgeometryvalidationservice.cpp b/src/app/qgsgeometryvalidationservice.cpp index d1097963753..e70e2ed4d12 100644 --- a/src/app/qgsgeometryvalidationservice.cpp +++ b/src/app/qgsgeometryvalidationservice.cpp @@ -66,6 +66,8 @@ void QgsGeometryValidationService::fixError( QgsGeometryCheckError *error, int m } } + layer->triggerRepaint(); + emit topologyErrorUpdated( layer, error ); }