Skip to content

Commit 660df4a

Browse files
committedJan 16, 2017
[Geometry checker] Fix result table corruption when adding newly found errors
1 parent c3508c2 commit 660df4a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
 

‎src/plugins/geometry_checker/ui/qgsgeometrycheckerresulttab.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ void QgsGeometryCheckerResultTab::finalize()
110110

111111
void QgsGeometryCheckerResultTab::addError( QgsGeometryCheckError *error )
112112
{
113+
bool sortingWasEnabled = ui.tableWidgetErrors->isSortingEnabled();
114+
if ( sortingWasEnabled )
115+
ui.tableWidgetErrors->setSortingEnabled( false );
116+
113117
int row = ui.tableWidgetErrors->rowCount();
114118
int prec = 7 - std::floor( qMax( 0., std::log10( qMax( error->location().x(), error->location().y() ) ) ) );
115119
QString posStr = QString( "%1, %2" ).arg( error->location().x(), 0, 'f', prec ).arg( error->location().y(), 0, 'f', prec );
@@ -142,6 +146,9 @@ void QgsGeometryCheckerResultTab::addError( QgsGeometryCheckError *error )
142146
ui.labelErrorCount->setText( tr( "Total errors: %1, fixed errors: %2" ).arg( mErrorCount ).arg( mFixedCount ) );
143147
mStatistics.newErrors.insert( error );
144148
mErrorMap.insert( error, QPersistentModelIndex( ui.tableWidgetErrors->model()->index( row, 0 ) ) );
149+
150+
if ( sortingWasEnabled )
151+
ui.tableWidgetErrors->setSortingEnabled( true );
145152
}
146153

147154
void QgsGeometryCheckerResultTab::updateError( QgsGeometryCheckError *error, bool statusChanged )

0 commit comments

Comments
 (0)
Please sign in to comment.