Skip to content

Commit

Permalink
Re-initialize relation editor on setRelationFeature
Browse files Browse the repository at this point in the history
Fix #11236
  • Loading branch information
m-kuhn committed Sep 22, 2014
1 parent d85f625 commit 96e39f7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/gui/qgsrelationeditorwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down

0 comments on commit 96e39f7

Please sign in to comment.