@@ -818,7 +818,6 @@ void QgsAttributeForm::updateConstraints( QgsEditorWidgetWrapper *eww )
818
818
819
819
void QgsAttributeForm::updateContainersVisibility ()
820
820
{
821
-
822
821
mExpressionContext << QgsExpressionContextUtils::formScope ( QgsFeature ( mFeature ), mContext .attributeFormModeString () );
823
822
824
823
const QVector<ContainerInformation *> infos = mContainerVisibilityInformation ;
@@ -1198,7 +1197,10 @@ void QgsAttributeForm::init()
1198
1197
tabWidget = nullptr ;
1199
1198
WidgetInfo widgetInfo = createWidgetFromDef ( widgDef, formWidget, mLayer , mContext );
1200
1199
layout->addWidget ( widgetInfo.widget , row, column, 1 , 2 );
1201
- registerContainerInformation ( new ContainerInformation ( widgetInfo.widget , containerDef->visibilityExpression ().data () ) );
1200
+ if ( containerDef->visibilityExpression ().enabled () )
1201
+ {
1202
+ registerContainerInformation ( new ContainerInformation ( widgetInfo.widget , containerDef->visibilityExpression ().data () ) );
1203
+ }
1202
1204
column += 2 ;
1203
1205
}
1204
1206
else
@@ -1744,7 +1746,10 @@ QgsAttributeForm::WidgetInfo QgsAttributeForm::createWidgetFromDef( const QgsAtt
1744
1746
if ( childDef->type () == QgsAttributeEditorElement::AeTypeContainer )
1745
1747
{
1746
1748
QgsAttributeEditorContainer *containerDef = static_cast <QgsAttributeEditorContainer *>( childDef );
1747
- registerContainerInformation ( new ContainerInformation ( widgetInfo.widget , containerDef->visibilityExpression ().data () ) );
1749
+ if ( containerDef->visibilityExpression ().enabled () )
1750
+ {
1751
+ registerContainerInformation ( new ContainerInformation ( widgetInfo.widget , containerDef->visibilityExpression ().data () ) );
1752
+ }
1748
1753
}
1749
1754
1750
1755
if ( widgetInfo.labelText .isNull () )
0 commit comments