Skip to content

Commit 06f92d2

Browse files
committed
fix updating table selection
1 parent 1b14524 commit 06f92d2

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/app/vertextool/qgsvertexeditor.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ void QgsVertexEditor::updateEditor( QgsLockedFeature *lockedFeature )
346346
mHintLabel->setVisible( false );
347347
mTableView->setVisible( true );
348348

349-
//connect( mLockedFeature, &QgsLockedFeature::selectionChanged, this, &QgsVertexEditor::updateTableSelection );
349+
connect( mLockedFeature, &QgsLockedFeature::selectionChanged, this, &QgsVertexEditor::updateTableSelection );
350350
}
351351
else
352352
{
@@ -373,9 +373,9 @@ void QgsVertexEditor::updateTableSelection()
373373
selection.select( mVertexModel->index( i, 0 ), mVertexModel->index( i, mVertexModel->columnCount() - 1 ) );
374374
}
375375
}
376-
//disconnect( mLockedFeature, &QgsLockedFeature::selectionChanged, this, &QgsVertexEditor::updateTableSelection );
376+
disconnect( mLockedFeature, &QgsLockedFeature::selectionChanged, this, &QgsVertexEditor::updateTableSelection );
377377
mTableView->selectionModel()->select( selection, QItemSelectionModel::ClearAndSelect );
378-
//connect( mLockedFeature, &QgsLockedFeature::selectionChanged, this, &QgsVertexEditor::updateTableSelection );
378+
connect( mLockedFeature, &QgsLockedFeature::selectionChanged, this, &QgsVertexEditor::updateTableSelection );
379379

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

src/app/vertextool/qgsvertextool.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -2319,16 +2319,19 @@ void QgsVertexTool::setHighlightedVertices( const QList<Vertex> &listVertices, H
23192319
if ( mLockedFeature )
23202320
{
23212321
disconnect( mLockedFeature.get(), &QgsLockedFeature::selectionChanged, this, &QgsVertexTool::lockedFeatureSelectionChanged );
2322+
2323+
mLockedFeature->deselectAllVertices();
23222324
for ( const Vertex &vertex : qgis::as_const( mSelectedVertices ) )
23232325
{
23242326
// we should never be able to select vertices that are not from the locked feature
23252327
Q_ASSERT( mLockedFeature->featureId() == vertex.fid && mLockedFeature->layer() == vertex.layer );
23262328
mLockedFeature->selectVertex( vertex.vertexId );
23272329
}
2328-
connect( mLockedFeature.get(), &QgsLockedFeature::selectionChanged, this, &QgsVertexTool::lockedFeatureSelectionChanged );
23292330

2330-
if ( mVertexEditor )
2331-
mVertexEditor->updateTableSelection();
2331+
// if ( mVertexEditor )
2332+
// mVertexEditor->updateTableSelection();
2333+
2334+
connect( mLockedFeature.get(), &QgsLockedFeature::selectionChanged, this, &QgsVertexTool::lockedFeatureSelectionChanged );
23322335
}
23332336
}
23342337

0 commit comments

Comments
 (0)