Skip to content
Permalink
Browse files

Hide subform in N:M relations

  • Loading branch information
m-kuhn committed Mar 11, 2016
1 parent 29d2d28 commit 3fd3dae35a216797a11727521dadecc8e5e86491
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/gui/editorwidgets/qgsrelationwidgetwrapper.cpp
@@ -59,11 +59,14 @@ void QgsRelationWidgetWrapper::initWidget( QWidget* editor )

w->setEditorContext( myContext );

QgsRelation nmrel = QgsProject::instance()->relationManager()->relation( config( "nm-rel" ).toString() );

// If this widget is already embedded by the same relation, reduce functionality
const QgsAttributeEditorContext* ctx = &context();
do
{
if ( ctx->relation().name() == mRelation.name() && ctx->formMode() == QgsAttributeEditorContext::Embed )
if (( ctx->relation().name() == mRelation.name() && ctx->formMode() == QgsAttributeEditorContext::Embed )
|| ctx->relation().name() == nmrel.name() )
{
w->setVisible( false );
break;
@@ -72,7 +75,6 @@ void QgsRelationWidgetWrapper::initWidget( QWidget* editor )
}
while ( ctx );

QgsRelation nmrel = QgsProject::instance()->relationManager()->relation( config( "nm-rel" ).toString() );

w->setRelations( mRelation, nmrel );

0 comments on commit 3fd3dae

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