Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
properly get layer from a QgsProcessingFeatureSourceDefinition (#41457)
- Loading branch information
Showing
with
9 additions
and
1 deletion.
-
+9
−1
src/gui/processing/qgsprocessingwidgetwrapperimpl.cpp
|
@@ -2005,7 +2005,15 @@ void QgsProcessingExpressionWidgetWrapper::setParentLayerWrapperValue( const Qgs |
|
|
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 ) |
|
|
{ |
|
|
if ( mFieldExpWidget ) |
|
|