Skip to content

Commit 35d7fdc

Browse files
committed
Fix the selected error
1 parent e65f6b4 commit 35d7fdc

3 files changed

+9
-1
lines changed

src/app/qgsgeometryvalidationdock.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,16 @@ void QgsGeometryValidationDock::onCurrentErrorChanged( const QModelIndex &curren
173173
mPreviousButton->setEnabled( current.isValid() && current.row() > 0 );
174174

175175
mProblemDetailWidget->setVisible( current.isValid() );
176+
177+
if ( !current.isValid() )
178+
return;
179+
176180
mProblemDescriptionLabel->setText( current.data( QgsGeometryValidationModel::DetailsRole ).toString() );
177181

178182
QgsGeometryCheckError *error = current.data( QgsGeometryValidationModel::GeometryCheckErrorRole ).value<QgsGeometryCheckError *>();
179183
if ( error )
180184
{
185+
delete mResolutionWidget->layout();
181186
const QStringList resolutionMethods = error->check()->resolutionMethods();
182187
QGridLayout *layout = new QGridLayout( mResolutionWidget );
183188
int resolutionIndex = 0;

src/app/qgsgeometryvalidationmodel.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,8 @@ void QgsGeometryValidationModel::onTopologyErrorUpdated( QgsVectorLayer *layer,
333333
if ( layer == mCurrentLayer )
334334
{
335335
int i = 0;
336-
for ( const auto &currentError : qgis::as_const( mTopologyErrorStorage[layer] ) )
336+
const auto &errors = mTopologyErrorStorage[layer];
337+
for ( const auto &currentError : errors )
337338
{
338339
if ( currentError.get() == error )
339340
{

src/app/qgsgeometryvalidationservice.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ void QgsGeometryValidationService::fixError( QgsGeometryCheckError *error, int m
6666
}
6767
}
6868

69+
layer->triggerRepaint();
70+
6971
emit topologyErrorUpdated( layer, error );
7072
}
7173

0 commit comments

Comments
 (0)