Skip to content
Permalink
Browse files

first import

  • Loading branch information
signedav committed Dec 14, 2017
1 parent 0f6a5c8 commit eb59e6d45bff1f1a26cdc7f969a787e13e086511
Showing with 15 additions and 0 deletions.
  1. +13 −0 src/gui/qgsrelationeditorwidget.cpp
  2. +2 −0 src/gui/qgsrelationeditorwidget.h
@@ -66,6 +66,13 @@ QgsRelationEditorWidget::QgsRelationEditorWidget( QWidget *parent )
mAddFeatureButton->setToolTip( tr( "Add child feature" ) );
mAddFeatureButton->setObjectName( QStringLiteral( "mAddFeatureButton" ) );
buttonLayout->addWidget( mAddFeatureButton );
// duplicate feature
mDuplicateFeatureButton = new QToolButton( this );
mDuplicateFeatureButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionDuplicateFeature.svg" ) ) );
mDuplicateFeatureButton->setText( tr( "Duplicate child feature" ) );
mDuplicateFeatureButton->setToolTip( tr( "Duplicate child feature" ) );
mDuplicateFeatureButton->setObjectName( QStringLiteral( "mDuplicateFeatureButton" ) );
buttonLayout->addWidget( mDuplicateFeatureButton );
// delete feature
mDeleteFeatureButton = new QToolButton( this );
mDeleteFeatureButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionDeleteSelected.svg" ) ) );
@@ -130,6 +137,7 @@ QgsRelationEditorWidget::QgsRelationEditorWidget( QWidget *parent )
connect( mToggleEditingButton, &QAbstractButton::clicked, this, &QgsRelationEditorWidget::toggleEditing );
connect( mSaveEditsButton, &QAbstractButton::clicked, this, &QgsRelationEditorWidget::saveEdits );
connect( mAddFeatureButton, &QAbstractButton::clicked, this, &QgsRelationEditorWidget::addFeature );
connect( mDuplicateFeatureButton, &QAbstractButton::clicked, this, &QgsRelationEditorWidget::duplicateFeature );
connect( mDeleteFeatureButton, &QAbstractButton::clicked, this, &QgsRelationEditorWidget::deleteFeature );
connect( mLinkFeatureButton, &QAbstractButton::clicked, this, &QgsRelationEditorWidget::linkFeature );
connect( mUnlinkFeatureButton, &QAbstractButton::clicked, this, &QgsRelationEditorWidget::unlinkFeature );
@@ -286,6 +294,7 @@ void QgsRelationEditorWidget::updateButtons()
}

mAddFeatureButton->setEnabled( editable );
mDuplicateFeatureButton->setEnabled( editable && selectionNotEmpty );
mLinkFeatureButton->setEnabled( linkable );
mDeleteFeatureButton->setEnabled( editable && selectionNotEmpty );
mUnlinkFeatureButton->setEnabled( linkable && selectionNotEmpty );
@@ -425,6 +434,10 @@ void QgsRelationEditorWidget::linkFeature()
}
}

void QgsRelationEditorWidget::duplicateFeature()
{
}

void QgsRelationEditorWidget::deleteFeature()
{
QgsVectorLayer *layer = nullptr;
@@ -146,6 +146,7 @@ class GUI_EXPORT QgsRelationEditorWidget : public QgsCollapsibleGroupBox
void updateButtons();

void addFeature();
void duplicateFeature();
void linkFeature();
void deleteFeature();
void unlinkFeature();
@@ -167,6 +168,7 @@ class GUI_EXPORT QgsRelationEditorWidget : public QgsCollapsibleGroupBox
QToolButton *mToggleEditingButton = nullptr;
QToolButton *mSaveEditsButton = nullptr;
QToolButton *mAddFeatureButton = nullptr;
QToolButton *mDuplicateFeatureButton = nullptr;
QToolButton *mDeleteFeatureButton = nullptr;
QToolButton *mLinkFeatureButton = nullptr;
QToolButton *mUnlinkFeatureButton = nullptr;

0 comments on commit eb59e6d

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