Skip to content
Permalink
Browse files
Only with models
  • Loading branch information
roya0045 authored and nyalldawson committed Jan 14, 2021
1 parent 6ea2ff5 commit 5a9e8c6290c2ddedf789ad89064323919c86d727
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/gui/processing/qgsprocessingwidgetwrapperimpl.cpp
@@ -1848,8 +1848,11 @@ QgsProcessingExpressionParameterDefinitionWidget::QgsProcessingExpressionParamet
vlayout->addWidget( new QLabel( tr( "Default value" ) ) );

mDefaultLineEdit = new QgsExpressionLineEdit();
QgsExpressionContext expressionContext = createExpressionContext( context, algorithm );
mDefaultLineEdit->setExpressionContext( expressionContext );
if ( mModel )
{
QgsExpressionContext expressionContext = createExpressionContext( context, algorithm );
mDefaultLineEdit->setExpressionContext( expressionContext );
}
if ( const QgsProcessingParameterExpression *expParam = dynamic_cast<const QgsProcessingParameterExpression *>( definition ) )
mDefaultLineEdit->setExpression( QgsProcessingParameters::parameterAsExpression( expParam, expParam->defaultValueForGui(), context ) );
vlayout->addWidget( mDefaultLineEdit );

0 comments on commit 5a9e8c6

Please sign in to comment.