Skip to content

Commit

Permalink
[vertex editor] connect selection model after setting the model
Browse files Browse the repository at this point in the history
otherwise, the selection model is a null pointer
  • Loading branch information
3nids committed Jun 7, 2018
1 parent 51ae8e9 commit 83a4fbf
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/app/vertextool/qgsvertexeditor.cpp
Expand Up @@ -293,8 +293,6 @@ QgsVertexEditor::QgsVertexEditor(

setWidget( mTableView );

connect( mTableView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &QgsVertexEditor::updateVertexSelection );

updateEditor( layer, selectedFeature );
}

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

connect( mSelectedFeature, &QgsSelectedFeature::selectionChanged, this, &QgsVertexEditor::updateTableSelection );
}
Expand Down

0 comments on commit 83a4fbf

Please sign in to comment.