Skip to content

Commit

Permalink
Properly highlight all selected errors
Browse files Browse the repository at this point in the history
  • Loading branch information
uclaros authored and nyalldawson committed Sep 29, 2021
1 parent 2f53ccd commit b593511
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
17 changes: 4 additions & 13 deletions src/plugins/geometry_checker/qgsgeometrycheckerresulttab.cpp
Expand Up @@ -83,7 +83,7 @@ QgsGeometryCheckerResultTab::QgsGeometryCheckerResultTab( QgisInterface *iface,
connect( ui.pushButtonFixWithDefault, &QAbstractButton::clicked, this, &QgsGeometryCheckerResultTab::fixErrorsWithDefault );
connect( ui.pushButtonFixWithPrompt, &QAbstractButton::clicked, this, &QgsGeometryCheckerResultTab::fixErrorsWithPrompt );
connect( ui.pushButtonErrorResolutionSettings, &QAbstractButton::clicked, this, &QgsGeometryCheckerResultTab::setDefaultResolutionMethods );
connect( ui.checkBoxHighlight, &QAbstractButton::clicked, this, &QgsGeometryCheckerResultTab::highlightErrors );
connect( ui.checkBoxHighlight, &QAbstractButton::clicked, this, [ = ] { QgsGeometryCheckerResultTab::highlightErrors(); } );
connect( QgsProject::instance(), static_cast<void ( QgsProject::* )( const QStringList & )>( &QgsProject::layersWillBeRemoved ), this, &QgsGeometryCheckerResultTab::checkRemovedLayer );
connect( ui.pushButtonExport, &QAbstractButton::clicked, this, &QgsGeometryCheckerResultTab::exportErrors );

Expand Down Expand Up @@ -418,19 +418,10 @@ void QgsGeometryCheckerResultTab::highlightErrors( bool current )
mIface->mapCanvas()->refresh();
}

void QgsGeometryCheckerResultTab::onSelectionChanged( const QItemSelection &newSel, const QItemSelection &/*oldSel*/ )
void QgsGeometryCheckerResultTab::onSelectionChanged()
{
QModelIndex idx = ui.tableWidgetErrors->currentIndex();
if ( idx.isValid() && !ui.tableWidgetErrors->isRowHidden( idx.row() ) && newSel.contains( idx ) )
{
highlightErrors();
}
else
{
qDeleteAll( mCurrentRubberBands );
mCurrentRubberBands.clear();
}
ui.pushButtonOpenAttributeTable->setEnabled( !newSel.isEmpty() );
highlightErrors();
ui.pushButtonOpenAttributeTable->setEnabled( ui.tableWidgetErrors->selectionModel()->hasSelection() );
}

void QgsGeometryCheckerResultTab::openAttributeTable()
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/geometry_checker/qgsgeometrycheckerresulttab.h
Expand Up @@ -63,7 +63,7 @@ class QgsGeometryCheckerResultTab : public QWidget
void exportErrors();
void highlightError( QgsGeometryCheckError *error );
void highlightErrors( bool current = false );
void onSelectionChanged( const QItemSelection &newSel, const QItemSelection & /*oldSel*/ );
void onSelectionChanged();
void openAttributeTable();
void fixErrorsWithDefault() { fixErrors( false ); }
void fixErrorsWithPrompt() { fixErrors( true ); }
Expand Down

0 comments on commit b593511

Please sign in to comment.