Skip to content
Permalink
Browse files

functionality to duplicate features

  • Loading branch information
signedav committed Dec 18, 2017
1 parent eb59e6d commit 67daecddf413108e9f3550172a0c6a48d70d6191
Showing with 15 additions and 0 deletions.
  1. +15 −0 src/gui/qgsrelationeditorwidget.cpp
@@ -436,6 +436,21 @@ void QgsRelationEditorWidget::linkFeature()

void QgsRelationEditorWidget::duplicateFeature()
{
QgsVectorLayer *layer = nullptr;

layer = mNmRelation.referencingLayer();

const QgsFeatureIds fids = mFeatureSelectionMgr->selectedFeatureIds();

for ( const QgsFeatureId &fid : fids )
{
QgsVectorLayerUtils::QgsDuplicateFeatureContext duplicatedFeatureContext;
QgsFeature feature; //= layer->getFeature( fid );
QgsFeatureRequest freq;
freq.setFilterFid( fid );
layer->getFeatures( freq ).nextFeature( feature );
QgsVectorLayerUtils::duplicateFeature( layer, feature, QgsProject::instance(), 1, duplicatedFeatureContext );
}
}

void QgsRelationEditorWidget::deleteFeature()

0 comments on commit 67daecd

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