35 if ( input.type() != QVariant::List )
38 const QVariantList variantLayers = input.toList();
40 if ( variantLayers.isEmpty() )
43 for (
const QVariant &variantLayer : variantLayers )
45 if ( variantLayer.type() != QVariant::Map )
47 const QVariantMap layerMap = variantLayer.toMap();
49 if ( !layerMap.contains( QStringLiteral(
"source" ) ) ||
50 !layerMap.contains( QStringLiteral(
"type" ) ) ||
51 !layerMap.contains( QStringLiteral(
"attributeIndex" ) ) )
63 if ( layerMap.value( QStringLiteral(
"attributeIndex" ) ).toInt() >= vectorLayer->
fields().
count() )
74 const QVariantList variantLayers = value.toList();
75 for (
const QVariant &variantLayer : variantLayers )
77 const QVariantMap layerMap = variantLayer.toMap();
78 QStringList layerDefParts;
82 QString layerDef = QStringLiteral(
"{%1}" ).arg( layerDefParts.join(
',' ) );
83 parts.append( layerDef );
85 return parts.join(
',' ).prepend(
'[' ).append(
']' );
94 QString code = QStringLiteral(
"QgsProcessingParameterTinInputLayers('%1', '%2')" ).arg(
name(),
description() );