Skip to content
Permalink
Browse files

Much faster selection of large number of nodes using node tool

Refs #13963
  • Loading branch information
nyalldawson committed Jul 5, 2016
1 parent ab13c63 commit 102ba2d3c51b2541f3b56301c58224a517323dd1
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/app/nodetool/qgsnodeeditor.cpp
@@ -319,15 +319,17 @@ void QgsNodeEditor::updateTableSelection()
mTableView->selectionModel()->clearSelection();
const QList<QgsVertexEntry*>& vertexMap = mSelectedFeature->vertexMap();
int firstSelectedRow = -1;
QItemSelection selection;
for ( int i = 0, n = vertexMap.size(); i < n; ++i )
{
if ( vertexMap[i]->isSelected() )
{
if ( firstSelectedRow < 0 )
firstSelectedRow = i;
mTableView->selectionModel()->select( mNodeModel->index( i, 0 ), QItemSelectionModel::Rows | QItemSelectionModel::Select );
selection.select( mNodeModel->index( i, 0 ), mNodeModel->index( i, mNodeModel->columnCount() - 1 ) );
}
}
mTableView->selectionModel()->select( selection, QItemSelectionModel::Select );

if ( firstSelectedRow >= 0 )
mTableView->scrollTo( mNodeModel->index( firstSelectedRow, 0 ), QAbstractItemView::PositionAtTop );

0 comments on commit 102ba2d

Please sign in to comment.
You can’t perform that action at this time.