Skip to content

Commit 2a19a1d

Browse files
committedSep 13, 2018
fix get layer from output sink from previous algorithm in modeler
1 parent 0f07c41 commit 2a19a1d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
 

‎src/core/processing/qgsprocessingparameters.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,18 @@ QgsMapLayer *QgsProcessingParameters::parameterAsLayer( const QgsProcessingParam
528528
return layer;
529529
}
530530

531+
if ( val.canConvert<QgsProcessingOutputLayerDefinition>() )
532+
{
533+
// input is a QgsProcessingOutputLayerDefinition - get extra properties from it
534+
QgsProcessingOutputLayerDefinition fromVar = qvariant_cast<QgsProcessingOutputLayerDefinition>( val );
535+
val = fromVar.sink;
536+
}
537+
538+
if ( val.canConvert<QgsProperty>() && val.value< QgsProperty >().propertyType() == QgsProperty::StaticProperty )
539+
{
540+
val = val.value< QgsProperty >().staticValue();
541+
}
542+
531543
if ( !val.isValid() || val.toString().isEmpty() )
532544
{
533545
// fall back to default

0 commit comments

Comments
 (0)
Please sign in to comment.