Skip to content
Permalink
Browse files

[vertex tool] fix editor not updated on geometry changed

slots were not triggered in appropriate order
so we let the vertex tool handle the update of the locked feature geometry on update
  • Loading branch information
3nids committed Apr 2, 2019
1 parent 04c5302 commit 8a89c5825f8ea71ab2e8ffe412ad17dcdeb9bee5
Showing with 13 additions and 11 deletions.
  1. +0 −9 src/app/vertextool/qgslockedfeature.cpp
  2. +13 −2 src/app/vertextool/qgsvertextool.cpp
@@ -42,15 +42,6 @@ QgsLockedFeature::QgsLockedFeature( QgsFeatureId featureId,
// signal changing of current layer
connect( QgisApp::instance()->layerTreeView(), &QgsLayerTreeView::currentLayerChanged, this, &QgsLockedFeature::currentLayerChanged );

// feature was deleted
connect( mLayer, &QgsVectorLayer::featureDeleted, this, &QgsLockedFeature::featureDeleted );

// rolling back
connect( mLayer, &QgsVectorLayer::beforeRollBack, this, &QgsLockedFeature::beforeRollBack );

// geometry was changed
connect( mLayer, &QgsVectorLayer::geometryChanged, this, &QgsLockedFeature::geometryChanged );

replaceVertexMap();
}

@@ -1304,8 +1304,13 @@ void QgsVertexTool::onCachedGeometryChanged( QgsFeatureId fid, const QgsGeometry
// re-run validation for the feature
validateGeometry( layer, fid );

if ( mVertexEditor && mLockedFeature && mLockedFeature->featureId() == fid && mLockedFeature->layer() == layer )
mVertexEditor->updateEditor( mLockedFeature.get() );
if ( mLockedFeature && mLockedFeature->featureId() == fid && mLockedFeature->layer() == layer )
{
mLockedFeature->geometryChanged( fid, geom );
if ( mVertexEditor )
mVertexEditor->updateEditor( mLockedFeature.get() );
updateLockedFeatureVertices();
}
}

void QgsVertexTool::onCachedGeometryDeleted( QgsFeatureId fid )
@@ -1318,6 +1323,12 @@ void QgsVertexTool::onCachedGeometryDeleted( QgsFeatureId fid )

// refresh highlighted vertices - some may have been deleted
setHighlightedVertices( mSelectedVertices );

if ( mLockedFeature && mLockedFeature->featureId() == fid && mLockedFeature->layer() == layer )
{
mLockedFeature->featureDeleted( fid );
updateLockedFeatureVertices();
}
}

void QgsVertexTool::updateVertexEditor( QgsVectorLayer *layer, QgsFeatureId fid )

0 comments on commit 8a89c58

Please sign in to comment.
You can’t perform that action at this time.