Skip to content
Permalink
Browse files

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

  • Loading branch information
3nids committed Jul 7, 2020
1 parent d14b349 commit ed000d432cf77c1291f5ffd073d08852f92fc260
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 ed000d4

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