QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
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 const QString layerDef = QStringLiteral(
"{%1}" ).arg( layerDefParts.join(
',' ) );
83 parts.append( layerDef );
85 return parts.join(
',' ).prepend(
'[' ).append(
']' );
94 QString code = QStringLiteral(
"QgsProcessingParameterTinInputLayers('%1', %2)" )
@ VectorLayer
Vector layer.
QString description() const
Returns the description for the parameter.
int count() const
Returns number of items.
Base class for the definition of processing parameters.
static QString stringToPythonLiteral(const QString &string)
Converts a string to a Python string literal.
QgsFields fields() const FINAL
Returns the list of fields of this layer.
@ PythonQgsProcessingAlgorithmSubclass
Full Python QgsProcessingAlgorithm subclass.
Contains information about the context in which a processing algorithm is executed.
QString name() const
Returns the name of the parameter.
Represents a vector layer which manages a vector based data sets.
static QString variantToPythonLiteral(const QVariant &value)
Converts a variant to a Python literal.
Base class for all map layer types. This is the base class for all map layer types (vector,...
static QgsMapLayer * mapLayerFromString(const QString &string, QgsProcessingContext &context, bool allowLoadingNewLayers=true, QgsProcessingUtils::LayerHint typeHint=QgsProcessingUtils::LayerHint::UnknownType)
Interprets a string as a map layer within the supplied context.
PythonOutputType
Available Python output types.