Skip to content
Permalink
Browse files

check if visibilityexpression is enabled (#8141)

before adding the containers to the mContainerVisibilityInformation

fix: #20045
  • Loading branch information
signedav authored and 3nids committed Oct 8, 2018
1 parent 425fe74 commit f5d2b88dbaa9c20fcf2bc7153f1ce74650f19950
Showing with 8 additions and 3 deletions.
  1. +8 −3 src/gui/qgsattributeform.cpp
@@ -818,7 +818,6 @@ void QgsAttributeForm::updateConstraints( QgsEditorWidgetWrapper *eww )

void QgsAttributeForm::updateContainersVisibility()
{

mExpressionContext << QgsExpressionContextUtils::formScope( QgsFeature( mFeature ), mContext.attributeFormModeString() );

const QVector<ContainerInformation *> infos = mContainerVisibilityInformation;
@@ -1198,7 +1197,10 @@ void QgsAttributeForm::init()
tabWidget = nullptr;
WidgetInfo widgetInfo = createWidgetFromDef( widgDef, formWidget, mLayer, mContext );
layout->addWidget( widgetInfo.widget, row, column, 1, 2 );
registerContainerInformation( new ContainerInformation( widgetInfo.widget, containerDef->visibilityExpression().data() ) );
if ( containerDef->visibilityExpression().enabled() )
{
registerContainerInformation( new ContainerInformation( widgetInfo.widget, containerDef->visibilityExpression().data() ) );
}
column += 2;
}
else
@@ -1744,7 +1746,10 @@ QgsAttributeForm::WidgetInfo QgsAttributeForm::createWidgetFromDef( const QgsAtt
if ( childDef->type() == QgsAttributeEditorElement::AeTypeContainer )
{
QgsAttributeEditorContainer *containerDef = static_cast<QgsAttributeEditorContainer *>( childDef );
registerContainerInformation( new ContainerInformation( widgetInfo.widget, containerDef->visibilityExpression().data() ) );
if ( containerDef->visibilityExpression().enabled() )
{
registerContainerInformation( new ContainerInformation( widgetInfo.widget, containerDef->visibilityExpression().data() ) );
}
}

if ( widgetInfo.labelText.isNull() )

0 comments on commit f5d2b88

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