Skip to content

Commit 83a4fbf

Browse files
committed
[vertex editor] connect selection model after setting the model
otherwise, the selection model is a null pointer
1 parent 51ae8e9 commit 83a4fbf

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/app/vertextool/qgsvertexeditor.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,6 @@ QgsVertexEditor::QgsVertexEditor(
293293

294294
setWidget( mTableView );
295295

296-
connect( mTableView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &QgsVertexEditor::updateVertexSelection );
297-
298296
updateEditor( layer, selectedFeature );
299297
}
300298

@@ -311,6 +309,7 @@ void QgsVertexEditor::updateEditor( QgsVectorLayer *layer, QgsSelectedFeature *s
311309
// TODO We really should just update the model itself.
312310
mVertexModel = new QgsVertexEditorModel( mLayer, mSelectedFeature, mCanvas, this );
313311
mTableView->setModel( mVertexModel );
312+
connect( mTableView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &QgsVertexEditor::updateVertexSelection );
314313

315314
connect( mSelectedFeature, &QgsSelectedFeature::selectionChanged, this, &QgsVertexEditor::updateTableSelection );
316315
}

0 commit comments

Comments
 (0)