Fix the selected error

This commit is contained in:
Matthias Kuhn 2018-10-03 07:10:29 +02:00
parent e65f6b46a7
commit 35d7fdc810
No known key found for this signature in database
GPG Key ID: 7A7F1A1C90C3E6A7
3 changed files with 9 additions and 1 deletions

View File

@ -173,11 +173,16 @@ void QgsGeometryValidationDock::onCurrentErrorChanged( const QModelIndex &curren
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<QgsGeometryCheckError *>();
if ( error )
{
delete mResolutionWidget->layout();
const QStringList resolutionMethods = error->check()->resolutionMethods();
QGridLayout *layout = new QGridLayout( mResolutionWidget );
int resolutionIndex = 0;

View File

@ -333,7 +333,8 @@ void QgsGeometryValidationModel::onTopologyErrorUpdated( QgsVectorLayer *layer,
if ( layer == mCurrentLayer )
{
int i = 0;
for ( const auto &currentError : qgis::as_const( mTopologyErrorStorage[layer] ) )
const auto &errors = mTopologyErrorStorage[layer];
for ( const auto &currentError : errors )
{
if ( currentError.get() == error )
{

View File

@ -66,6 +66,8 @@ void QgsGeometryValidationService::fixError( QgsGeometryCheckError *error, int m
}
}
layer->triggerRepaint();
emit topologyErrorUpdated( layer, error );
}