@@ -528,6 +528,8 @@ void QgsAttributeForm::init()
528
528
Q_FOREACH ( const QgsRelation& rel, QgsProject::instance ()->relationManager ()->referencedRelations ( mLayer ) )
529
529
{
530
530
QgsRelationWidgetWrapper* rww = new QgsRelationWidgetWrapper ( mLayer , rel, 0 , this );
531
+ QgsEditorWidgetConfig cfg = mLayer ->editFormConfig ()->widgetConfig ( rel.id () );
532
+ rww->setConfig ( cfg );
531
533
rww->setContext ( mContext );
532
534
gridLayout->addWidget ( rww->widget (), row++, 0 , 1 , 2 );
533
535
mWidgets .append ( rww );
@@ -717,6 +719,8 @@ QWidget* QgsAttributeForm::createWidgetFromDef( const QgsAttributeEditorElement
717
719
const QgsAttributeEditorRelation* relDef = dynamic_cast <const QgsAttributeEditorRelation*>( widgetDef );
718
720
719
721
QgsRelationWidgetWrapper* rww = new QgsRelationWidgetWrapper ( mLayer , relDef->relation (), 0 , this );
722
+ QgsEditorWidgetConfig cfg = mLayer ->editFormConfig ()->widgetConfig ( relDef->relation ().id () );
723
+ rww->setConfig ( cfg );
720
724
rww->setContext ( context );
721
725
newWidget = rww->widget ();
722
726
mWidgets .append ( rww );
@@ -839,7 +843,7 @@ void QgsAttributeForm::createWrappers()
839
843
if ( relation .isValid () )
840
844
{
841
845
QgsRelationWidgetWrapper* rww = new QgsRelationWidgetWrapper ( mLayer , relation , myWidget, this );
842
- rww->setConfig ( QgsEditorWidgetConfig ( ) );
846
+ rww->setConfig ( mLayer -> editFormConfig ()-> widgetConfig ( relation . id () ) );
843
847
rww->setContext ( mContext );
844
848
rww->widget (); // Will initialize the widget
845
849
mWidgets .append ( rww );
0 commit comments