Class: QgsProcessingModelParameter

class qgis.core.QgsProcessingModelParameter

Bases: QgsProcessingModelComponent

Represents an input parameter used by the model.

Added in version 3.0.

QgsProcessingModelParameter(parameterName: Optional[str] = ‘’) Constructor for QgsProcessingModelParameter. The parameter name should match one of the parameters from the parent model.

QgsProcessingModelParameter(a0: QgsProcessingModelParameter)

Methods

clone

rtype:

Optional[QgsProcessingModelParameter]

comment

rtype:

Optional[QgsProcessingModelComment]

copyNonDefinitionProperties

Copies all non-specific definition properties from the other component definition.

loadVariant

Loads this parameter from a QVariantMap.

parameterName

Returns the associated parameter name.

restoreCommonProperties

Restores the component properties from a QVariantMap.

saveCommonProperties

Saves the component properties to a QVariantMap.

setComment

param comment:

setParameterName

Sets the associated parameter name.

toVariant

Saves this parameter to a QVariant.

clone(self) QgsProcessingModelParameter | None
Return type:

Optional[QgsProcessingModelParameter]

comment(self) QgsProcessingModelComment | None
Return type:

Optional[QgsProcessingModelComment]

copyNonDefinitionProperties(self, other: QgsProcessingModelComponent)

Copies all non-specific definition properties from the other component definition.

This includes properties like the size and position of the component, but not properties like the specific algorithm or input details.

Added in version 3.14.

loadVariant(self, map: Dict[str, Any]) bool

Loads this parameter from a QVariantMap.

See also

toVariant()

Parameters:

map (Dict[str)

Return type:

bool

parameterName(self) str

Returns the associated parameter name. The parameter name should match one of the parameters from the parent model.

See also

parameterName()

Return type:

str

restoreCommonProperties(self, map: Dict[str, Any])

Restores the component properties from a QVariantMap.

saveCommonProperties(self, map: Dict[str, Any])

Saves the component properties to a QVariantMap.

setComment(self, comment: QgsProcessingModelComment)
Parameters:

comment (QgsProcessingModelComment)

setParameterName(self, name: str | None)

Sets the associated parameter name. The parameter name should match one of the parameters from the parent model.

See also

parameterName()

Parameters:

name (Optional[str])

toVariant(self) Any

Saves this parameter to a QVariant.

See also

loadVariant()

Return type:

Any