Class: QgsProcessingParameterDxfLayers

class qgis.core.QgsProcessingParameterDxfLayers

Bases: QgsProcessingParameterDefinition

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.

New in version 3.18.

QgsProcessingParameterDxfLayers(name: str, description: str = ‘’) Constructor for QgsProcessingParameterDxfLayers.

QgsProcessingParameterDxfLayers(QgsProcessingParameterDxfLayers)

Methods

asPythonString

param outputType:

checkValueIsAcceptable

param input:

clone

rtype:

QgsProcessingParameterDefinition

defaultGuiValueFromSetting

Default gui value for an algorithm parameter from settings

layerAsVariantMap

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

parameterAsLayers

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

type

rtype:

str

typeName

Returns the type name for the parameter class.

valueAsJsonObject

param value:

valueAsPythonString

param value:

valueAsString

param value:

variantMapAsLayer

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

asPythonString(self, outputType: QgsProcessing.PythonOutputType = QgsProcessing.PythonOutputType.PythonQgsProcessingAlgorithmSubclass) str
Parameters:

outputType (QgsProcessing.PythonOutputType = QgsProcessing.PythonOutputType.PythonQgsProcessingAlgorithmSubclass) –

Return type:

str

checkValueIsAcceptable(self, input: Any, context: QgsProcessingContext = None) bool
Parameters:
Return type:

bool

clone(self) QgsProcessingParameterDefinition
Return type:

QgsProcessingParameterDefinition

defaultGuiValueFromSetting(self) Any

Default gui value for an algorithm parameter from settings

Returns:

default value from settings or invalid QVariant if there is no default value defined in the settings

New in version 3.34.

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

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

Parameters:

layer (QgsDxfExport.DxfLayer) –

Return type:

Dict[str, Any]

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]

type(self) str
Return type:

str

typeName() str

Returns the type name for the parameter class.

Return type:

str

valueAsJsonObject(self, value: Any, context: QgsProcessingContext) Any
Parameters:
Return type:

Any

valueAsPythonString(self, value: Any, context: QgsProcessingContext) str
Parameters:
Return type:

str

valueAsString(self, value: Any, context: QgsProcessingContext) Tuple[str, bool]
Parameters:
Return type:

Tuple[str, bool]

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

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

Parameters:
Return type:

QgsDxfExport.DxfLayer