address @wonder-wonder-sk 's comments on node editor improvements

This commit is contained in:
nirvn 2019-01-23 08:50:24 +07:00 committed by Mathieu Pellerin
parent 1bf792cc4b
commit 63ee9a34f0
2 changed files with 4 additions and 2 deletions

View File

@ -337,6 +337,7 @@ void QgsVertexEditor::updateEditor( QgsVectorLayer *layer, QgsSelectedFeature *s
if ( mSelectedFeature )
{
delete mVertexModel;
mVertexModel = nullptr;
}
mLayer = layer;

View File

@ -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
{