mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-03 00:02:25 -05:00
Fixes #17576 Avoid crash during node editor cleanup
This commit is contained in:
parent
0310c1d253
commit
45ca0eb52b
@ -984,7 +984,7 @@ void QgsVertexTool::showVertexEditor() //#spellok
|
||||
mVertexEditor.reset( new QgsVertexEditor( m.layer(), mSelectedFeature.get(), mCanvas ) );
|
||||
QgisApp::instance()->addDockWidget( Qt::LeftDockWidgetArea, mVertexEditor.get() );
|
||||
connect( mVertexEditor.get(), &QgsVertexEditor::deleteSelectedRequested, this, &QgsVertexTool::deleteVertexEditorSelection );
|
||||
connect( mSelectedFeature.get()->vlayer(), &QgsVectorLayer::featureDeleted, this, [ = ]( QgsFeatureId id ) { if ( mSelectedFeature.get()->featureId() == id ) cleanupVertexEditor(); } );
|
||||
connect( mSelectedFeature.get()->vlayer(), &QgsVectorLayer::featureDeleted, this, &QgsVertexTool::cleanEditor );
|
||||
}
|
||||
|
||||
void QgsVertexTool::cleanupVertexEditor()
|
||||
@ -2161,3 +2161,11 @@ void QgsVertexTool::stopRangeVertexSelection()
|
||||
mSelectionMethod = SelectionNormal;
|
||||
setHighlightedVertices( QList<Vertex>() );
|
||||
}
|
||||
|
||||
void QgsVertexTool::cleanEditor( QgsFeatureId id )
|
||||
{
|
||||
if ( mSelectedFeature.get() && mSelectedFeature.get()->featureId() == id )
|
||||
{
|
||||
cleanupVertexEditor();
|
||||
};
|
||||
}
|
||||
|
@ -97,6 +97,8 @@ class APP_EXPORT QgsVertexTool : public QgsMapToolAdvancedDigitizing
|
||||
|
||||
void startRangeVertexSelection();
|
||||
|
||||
void cleanEditor( QgsFeatureId id );
|
||||
|
||||
private:
|
||||
|
||||
void buildDragBandsForVertices( const QSet<Vertex> &movingVertices, const QgsPointXY &dragVertexMapPoint );
|
||||
|
Loading…
x
Reference in New Issue
Block a user