@@ -313,6 +313,7 @@ QgsVertexTool::~QgsVertexTool()
313
313
delete mVertexBand ;
314
314
delete mEdgeBand ;
315
315
delete mEndpointMarker ;
316
+ delete mVertexEditor ;
316
317
}
317
318
318
319
void QgsVertexTool::activate ()
@@ -1391,12 +1392,12 @@ void QgsVertexTool::showVertexEditor() //#spellok
1391
1392
{
1392
1393
if ( !mVertexEditor )
1393
1394
{
1394
- mVertexEditor . reset ( new QgsVertexEditor ( mCanvas ) );
1395
- if ( !QgisApp::instance ()->restoreDockWidget ( mVertexEditor . get () ) )
1396
- QgisApp::instance ()->addDockWidget ( Qt::LeftDockWidgetArea, mVertexEditor . get () );
1395
+ mVertexEditor = new QgsVertexEditor ( mCanvas );
1396
+ if ( !QgisApp::instance ()->restoreDockWidget ( mVertexEditor ) )
1397
+ QgisApp::instance ()->addDockWidget ( Qt::LeftDockWidgetArea, mVertexEditor );
1397
1398
1398
- connect ( mVertexEditor . get () , &QgsVertexEditor::deleteSelectedRequested, this , &QgsVertexTool::deleteVertexEditorSelection );
1399
- connect ( mVertexEditor . get () , &QgsVertexEditor::editorClosed, this , &QgsVertexTool::cleanupVertexEditor );
1399
+ connect ( mVertexEditor , &QgsVertexEditor::deleteSelectedRequested, this , &QgsVertexTool::deleteVertexEditorSelection );
1400
+ connect ( mVertexEditor , &QgsVertexEditor::editorClosed, this , &QgsVertexTool::cleanupVertexEditor );
1400
1401
1401
1402
// timer required as showing/raising the vertex editor in the same function following restoreDockWidget fails
1402
1403
QTimer::singleShot ( 200 , this , [ = ] { mVertexEditor ->show (); mVertexEditor ->raise (); } );
@@ -1411,7 +1412,10 @@ void QgsVertexTool::showVertexEditor() //#spellok
1411
1412
void QgsVertexTool::cleanupVertexEditor ()
1412
1413
{
1413
1414
mLockedFeature .reset ();
1414
- mVertexEditor .reset ();
1415
+ // do not delete immediately because vertex editor
1416
+ // can be still used in the qt event loop
1417
+ mVertexEditor ->deleteLater ();
1418
+
1415
1419
updateLockedFeatureVertices ();
1416
1420
}
1417
1421
0 commit comments