@@ -66,6 +66,13 @@ QgsRelationEditorWidget::QgsRelationEditorWidget( QWidget *parent )
66
66
mAddFeatureButton ->setToolTip ( tr ( " Add child feature" ) );
67
67
mAddFeatureButton ->setObjectName ( QStringLiteral ( " mAddFeatureButton" ) );
68
68
buttonLayout->addWidget ( mAddFeatureButton );
69
+ // duplicate feature
70
+ mDuplicateFeatureButton = new QToolButton ( this );
71
+ mDuplicateFeatureButton ->setIcon ( QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionDuplicateFeature.svg" ) ) );
72
+ mDuplicateFeatureButton ->setText ( tr ( " Duplicate child feature" ) );
73
+ mDuplicateFeatureButton ->setToolTip ( tr ( " Duplicate child feature" ) );
74
+ mDuplicateFeatureButton ->setObjectName ( QStringLiteral ( " mDuplicateFeatureButton" ) );
75
+ buttonLayout->addWidget ( mDuplicateFeatureButton );
69
76
// delete feature
70
77
mDeleteFeatureButton = new QToolButton ( this );
71
78
mDeleteFeatureButton ->setIcon ( QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionDeleteSelected.svg" ) ) );
@@ -130,6 +137,7 @@ QgsRelationEditorWidget::QgsRelationEditorWidget( QWidget *parent )
130
137
connect ( mToggleEditingButton , &QAbstractButton::clicked, this , &QgsRelationEditorWidget::toggleEditing );
131
138
connect ( mSaveEditsButton , &QAbstractButton::clicked, this , &QgsRelationEditorWidget::saveEdits );
132
139
connect ( mAddFeatureButton , &QAbstractButton::clicked, this , &QgsRelationEditorWidget::addFeature );
140
+ connect ( mDuplicateFeatureButton , &QAbstractButton::clicked, this , &QgsRelationEditorWidget::duplicateFeature );
133
141
connect ( mDeleteFeatureButton , &QAbstractButton::clicked, this , &QgsRelationEditorWidget::deleteFeature );
134
142
connect ( mLinkFeatureButton , &QAbstractButton::clicked, this , &QgsRelationEditorWidget::linkFeature );
135
143
connect ( mUnlinkFeatureButton , &QAbstractButton::clicked, this , &QgsRelationEditorWidget::unlinkFeature );
@@ -286,6 +294,7 @@ void QgsRelationEditorWidget::updateButtons()
286
294
}
287
295
288
296
mAddFeatureButton ->setEnabled ( editable );
297
+ mDuplicateFeatureButton ->setEnabled ( editable && selectionNotEmpty );
289
298
mLinkFeatureButton ->setEnabled ( linkable );
290
299
mDeleteFeatureButton ->setEnabled ( editable && selectionNotEmpty );
291
300
mUnlinkFeatureButton ->setEnabled ( linkable && selectionNotEmpty );
@@ -425,6 +434,10 @@ void QgsRelationEditorWidget::linkFeature()
425
434
}
426
435
}
427
436
437
+ void QgsRelationEditorWidget::duplicateFeature ()
438
+ {
439
+ }
440
+
428
441
void QgsRelationEditorWidget::deleteFeature ()
429
442
{
430
443
QgsVectorLayer *layer = nullptr ;
0 commit comments