From 63ee9a34f052de5e6f9b5a9da2453660a4db1a01 Mon Sep 17 00:00:00 2001 From: nirvn Date: Wed, 23 Jan 2019 08:50:24 +0700 Subject: [PATCH] address @wonder-wonder-sk 's comments on node editor improvements --- src/app/vertextool/qgsvertexeditor.cpp | 1 + src/app/vertextool/qgsvertextool.cpp | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/vertextool/qgsvertexeditor.cpp b/src/app/vertextool/qgsvertexeditor.cpp index 7e77e1e3dfc..5138263ffa5 100644 --- a/src/app/vertextool/qgsvertexeditor.cpp +++ b/src/app/vertextool/qgsvertexeditor.cpp @@ -337,6 +337,7 @@ void QgsVertexEditor::updateEditor( QgsVectorLayer *layer, QgsSelectedFeature *s if ( mSelectedFeature ) { delete mVertexModel; + mVertexModel = nullptr; } mLayer = layer; diff --git a/src/app/vertextool/qgsvertextool.cpp b/src/app/vertextool/qgsvertextool.cpp index 46f248861cc..3bb01a17b87 100644 --- a/src/app/vertextool/qgsvertextool.cpp +++ b/src/app/vertextool/qgsvertextool.cpp @@ -1068,7 +1068,7 @@ void QgsVertexTool::onCachedGeometryDeleted( QgsFeatureId fid ) void QgsVertexTool::showVertexEditor() //#spellok { QgsPointLocator::Match m = mLastMouseMoveMatch; - if ( m.isValid() || m.layer() ) + if ( m.isValid() && m.layer() ) { if ( mSelectedFeature && mSelectedFeature->featureId() == m.featureId() && mSelectedFeature->layer() == m.layer() ) { @@ -1099,7 +1099,8 @@ void QgsVertexTool::showVertexEditor() //#spellok connect( mVertexEditor.get(), &QgsVertexEditor::deleteSelectedRequested, this, &QgsVertexTool::deleteVertexEditorSelection ); connect( mVertexEditor.get(), &QgsVertexEditor::editorClosed, this, &QgsVertexTool::cleanupVertexEditor ); - QTimer::singleShot( 100, this, [ = ] { mVertexEditor->show(); mVertexEditor->raise(); } ); + // timer required as showing/raising the vertex editor in the same function following restoreDockWidget fails + QTimer::singleShot( 200, this, [ = ] { mVertexEditor->show(); mVertexEditor->raise(); } ); } else {