Class: QgsProcessingParameterExpression

An expression parameter for processing algorithms.

Class Hierarchy

Inheritance diagram of qgis.core.QgsProcessingParameterExpression

Base classes

QgsProcessingParameterDefinition

Base class for the definition of processing parameters.

Methods

expressionType

Returns the parameter's expression type.

parentLayerParameterName

Returns the name of the parent layer parameter, or an empty string if this is not set.

setExpressionType

Sets the parameter's expression type.

setParentLayerParameterName

Sets the name of the parent layer parameter.

Static Methods

fromScriptCode

Creates a new parameter using the definition from a script code.

typeName

Returns the type name for the parameter class.

class qgis.core.QgsProcessingParameterExpression[source]

Bases: QgsProcessingParameterDefinition

__init__(name: str | None, description: str | None = '', defaultValue: Any = None, parentLayerParameterName: str | None = '', optional: bool = False, type: Qgis.ExpressionType = Qgis.ExpressionType.Qgis)

Constructor for QgsProcessingParameterExpression.

Parameters:
  • name (Optional[str])

  • description (Optional[str] = '')

  • defaultValue (Any = None)

  • parentLayerParameterName (Optional[str] = '')

  • optional (bool = False)

  • type (Qgis.ExpressionType = Qgis.ExpressionType.Qgis)

__init__(a0: QgsProcessingParameterExpression)
Parameters:

a0 (QgsProcessingParameterExpression)

expressionType(self) Qgis.ExpressionType[source]

Returns the parameter’s expression type.

Added in version 3.32.

Return type:

Qgis.ExpressionType

static fromScriptCode(name: str | None, description: str | None, isOptional: bool, definition: str | None) QgsProcessingParameterExpression | None[source]

Creates a new parameter using the definition from a script code.

Parameters:
  • name (Optional[str])

  • description (Optional[str])

  • isOptional (bool)

  • definition (Optional[str])

Return type:

Optional[QgsProcessingParameterExpression]

parentLayerParameterName(self) str[source]

Returns the name of the parent layer parameter, or an empty string if this is not set.

Return type:

str

setExpressionType(self, type: Qgis.ExpressionType)[source]

Sets the parameter’s expression type.

See also

expressionType()

Added in version 3.32.

Parameters:

type (Qgis.ExpressionType)

setParentLayerParameterName(self, parentLayerParameterName: str | None)[source]

Sets the name of the parent layer parameter. Use an empty string if this is not required.

Parameters:

parentLayerParameterName (Optional[str])

static typeName() str[source]

Returns the type name for the parameter class.

Return type:

str