Skip to content
Permalink
Browse files

fix adding relation with multiple field pairs from dialog (#37652)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
qgis-bot and github-actions committed Jul 7, 2020
1 parent 04d51ec commit 44ebe869006d91e7aa1934d79eade4fc8c66ba89
Showing with 5 additions and 1 deletion.
  1. +2 −0 src/app/qgsrelationadddlg.cpp
  2. +3 −1 src/app/qgsrelationmanagerdialog.cpp
@@ -239,6 +239,8 @@ QList< QPair< QString, QString > > QgsRelationAddDlg::references()
QList< QPair< QString, QString > > references;
for ( int i = 0; i < mFieldPairWidgets.count(); i++ )
{
if ( !mFieldPairWidgets.at( i )->isPairEnabled() )
continue;
QString referencingField = mFieldPairWidgets.at( i )->referencingField();
QString referencedField = mFieldPairWidgets.at( i )->referencedField();
references << qMakePair( referencingField, referencedField );
@@ -138,7 +138,9 @@ void QgsRelationManagerDialog::mBtnAddRelation_clicked()
++suffix;
}
relation.setId( relationId );
relation.addFieldPair( addDlg.references().at( 0 ).first, addDlg.references().at( 0 ).second );
const auto references = addDlg.references();
for ( const auto &reference : references )
relation.addFieldPair( reference.first, reference.second );
relation.setName( addDlg.relationName() );
relation.setStrength( addDlg.relationStrength() );

0 comments on commit 44ebe86

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