Skip to content

Commit 96e39f7

Browse files
committedSep 22, 2014
Re-initialize relation editor on setRelationFeature
Fix #11236
1 parent d85f625 commit 96e39f7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
 

‎src/gui/qgsrelationeditorwidget.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,17 @@ void QgsRelationEditorWidget::setRelationFeature( const QgsRelation& relation, c
146146

147147
bool canChangeAttributes = lyr->dataProvider()->capabilities() & QgsVectorDataProvider::ChangeAttributeValues;
148148
mToggleEditingButton->setEnabled( canChangeAttributes && !lyr->isReadOnly() );
149+
150+
// If not yet initialized, it is not (yet) visible, so we don't load it to be faster (lazy loading)
151+
// If it is already initialized, it has been set visible before and the currently shown feature is changing
152+
// and the widget needs updating
153+
154+
if ( mInitialized )
155+
{
156+
QgsFeatureRequest myRequest = mRelation.getRelatedFeaturesRequest( mFeature );
157+
158+
mDualView->init( mRelation.referencingLayer(), 0, myRequest, mEditorContext );
159+
}
149160
}
150161

151162
void QgsRelationEditorWidget::setEditorContext( const QgsAttributeEditorContext& context )

0 commit comments

Comments
 (0)
Please sign in to comment.