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 committed Jul 16, 2021
1 parent fafc962 commit 9983be7b4e2d8ed1b132cbfef1450c6fed1280a1
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 9983be7

Please sign in to comment.