Skip to content
Permalink
Browse files
[processing] Fix missing fields in data defined expression builder
when input layer is using selected features only

Fixes #40055
  • Loading branch information
nyalldawson authored and nirvn committed Jul 19, 2021
1 parent 5566654 commit 3164ede192c9cccf8fe6130baa297649a7940af3
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/gui/processing/qgsprocessingwidgetwrapper.cpp
@@ -331,7 +331,15 @@ void QgsAbstractProcessingParameterWidgetWrapper::setDynamicParentLayerParameter
context = tmpContext.get();
}

QgsVectorLayer *layer = QgsProcessingParameters::parameterAsVectorLayer( parentWrapper->parameterDefinition(), parentWrapper->parameterValue(), *context );
QVariant val = parentWrapper->parameterValue();
if ( val.canConvert<QgsProcessingFeatureSourceDefinition>() )
{
// input is a QgsProcessingFeatureSourceDefinition - get extra properties from it
QgsProcessingFeatureSourceDefinition fromVar = qvariant_cast<QgsProcessingFeatureSourceDefinition>( val );
val = fromVar.source;
}

QgsVectorLayer *layer = QgsProcessingParameters::parameterAsVectorLayer( parentWrapper->parameterDefinition(), val, *context );
if ( !layer )
{
mPropertyButton->setVectorLayer( nullptr );

0 comments on commit 3164ede

Please sign in to comment.