Skip to content
Permalink
Browse files

fix correct string list representation of QgsProcessingOutputLayerDef…

…inition
  • Loading branch information
luipir authored and nyalldawson committed Sep 20, 2018
1 parent a2db44c commit 006553f9d3836924b259c4fe1a7330baf09b1f69
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/core/processing/qgsprocessingparameters.cpp
@@ -1285,6 +1285,16 @@ QList<QgsMapLayer *> QgsProcessingParameters::parameterAsLayerList( const QgsPro
}
else if ( var.canConvert<QgsProperty>() )
resultStringList << var.value< QgsProperty >().valueAsString( context.expressionContext(), definition->defaultValue().toString() );
else if ( var.canConvert<QgsProcessingOutputLayerDefinition>() )
{
// input is a QgsProcessingOutputLayerDefinition - get extra properties from it
QgsProcessingOutputLayerDefinition fromVar = qvariant_cast<QgsProcessingOutputLayerDefinition>( var );
QVariant sink = fromVar.sink;
if ( sink.canConvert<QgsProperty>() )
{
resultStringList << sink.value< QgsProperty >().valueAsString( context.expressionContext(), definition->defaultValue().toString() );
}
}
else if ( QgsMapLayer *layer = qobject_cast< QgsMapLayer * >( qvariant_cast<QObject *>( var ) ) )
{
layers << layer;

0 comments on commit 006553f

Please sign in to comment.
You can’t perform that action at this time.