Class: QgsProcessingParameterDxfLayers

A parameter for Processing algorithms that need a list of input vector layers to export as DXF file.

This parameter provides Processing framework’s adapter for QList<QgsDxfExport.DxfLayer>.

A valid value for this parameter is a list (QVariantList), where each item is a map (QVariantMap) in this form:

{
  'layer':  string or QgsMapLayer,
  'attributeIndex': int
}

Also it can accept lists (either string lists or QgsVectorLayer list) as well as individual layer object or string representing layer source.

Static functions parametersAsLayers(), variantMapAsLayer(), layerAsVariantMap() provide conversion between QgsDxfExport.DxfLayer representation and QVariant representation.

Added in version 3.18.

Class Hierarchy

Inheritance diagram of qgis.core.QgsProcessingParameterDxfLayers

Base classes

QgsProcessingParameterDefinition

Base class for the definition of processing parameters.

Static Methods

layerAsVariantMap

Converts a single input layer to QVariant representation (a QVariantMap)

parameterAsLayers

Converts a QVariant value (a QVariantList) to a list of input layers

typeName

Returns the type name for the parameter class.

variantMapAsLayer

Converts a QVariant value (a QVariantMap) to a single input layer

class qgis.core.QgsProcessingParameterDxfLayers[source]

Bases: QgsProcessingParameterDefinition

__init__(name: str | None, description: str | None = '')

Constructor for QgsProcessingParameterDxfLayers.

Parameters:
  • name (Optional[str])

  • description (Optional[str] = '')

__init__(a0: QgsProcessingParameterDxfLayers)
Parameters:

a0 (QgsProcessingParameterDxfLayers)

static layerAsVariantMap(layer: QgsDxfExport.DxfLayer) Dict[str, Any][source]

Converts a single input layer to QVariant representation (a QVariantMap)

Parameters:

layer (QgsDxfExport.DxfLayer)

Return type:

Dict[str, Any]

static parameterAsLayers(layersVariant: Any, context: QgsProcessingContext) List[QgsDxfExport.DxfLayer]

Converts a QVariant value (a QVariantList) to a list of input layers

Parameters:
Return type:

List[QgsDxfExport.DxfLayer]

static typeName() str[source]

Returns the type name for the parameter class.

Return type:

str

static variantMapAsLayer(layerVariantMap: Dict[str, Any], context: QgsProcessingContext) QgsDxfExport.DxfLayer[source]

Converts a QVariant value (a QVariantMap) to a single input layer

Parameters:
Return type:

QgsDxfExport.DxfLayer