Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Pass referencing record instead of referenced
- Loading branch information
Showing
with
3 additions
and
1 deletion.
-
+3
−1
src/gui/editorwidgets/qgsrelationreferencewidget.cpp
|
@@ -245,8 +245,10 @@ void QgsRelationReferenceWidget::setForeignKey( const QVariant& value ) |
|
|
if ( !mReferencedLayer ) |
|
|
return; |
|
|
|
|
|
// Attributes from the referencing layer |
|
|
QgsAttributes attrs = QgsAttributes( mReferencingLayer->fields().count() ); |
|
|
attrs[mFkeyFieldIdx] = value; |
|
|
// Set the value on the foreign key field of the referencing record |
|
|
attrs[ mReferencingLayer->fieldNameIndex( mRelation.fieldPairs().at( 0 ).first )] = value; |
|
|
|
|
|
QgsFeatureRequest request = mRelation.getReferencedFeatureRequest( attrs ); |
|
|
|
|
|