Skip to content
Permalink
Browse files

Re-initialize relation editor on setRelationFeature

Fix #11236
  • Loading branch information
m-kuhn committed Sep 22, 2014
1 parent d85f625 commit 96e39f75675dc1d02de99833880513e3ca85ae45
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/gui/qgsrelationeditorwidget.cpp
@@ -146,6 +146,17 @@ void QgsRelationEditorWidget::setRelationFeature( const QgsRelation& relation, c

bool canChangeAttributes = lyr->dataProvider()->capabilities() & QgsVectorDataProvider::ChangeAttributeValues;
mToggleEditingButton->setEnabled( canChangeAttributes && !lyr->isReadOnly() );

// If not yet initialized, it is not (yet) visible, so we don't load it to be faster (lazy loading)
// If it is already initialized, it has been set visible before and the currently shown feature is changing
// and the widget needs updating

if ( mInitialized )
{
QgsFeatureRequest myRequest = mRelation.getRelatedFeaturesRequest( mFeature );

mDualView->init( mRelation.referencingLayer(), 0, myRequest, mEditorContext );
}
}

void QgsRelationEditorWidget::setEditorContext( const QgsAttributeEditorContext& context )

0 comments on commit 96e39f7

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