Class: QgsProcessingOutputDefinition

Base class for the definition of processing outputs.

Output definitions encapsulate the properties regarding the outputs from algorithms, such as generated layers or calculated values.

Note

This is an abstract class, with methods which must be implemented by a subclass.

The following methods must be implemented: type()

Class Hierarchy

Inheritance diagram of qgis.core.QgsProcessingOutputDefinition

Subclasses

QgsProcessingOutputBoolean

A boolean output for processing algorithms.

QgsProcessingOutputConditionalBranch

A conditional branch output for processing algorithms, which represents a possible model logic flow which branches out from this algorithm.

QgsProcessingOutputFile

A file output for processing algorithms.

QgsProcessingOutputFolder

A folder output for processing algorithms.

QgsProcessingOutputHtml

A HTML file output for processing algorithms.

QgsProcessingOutputMapLayer

A map layer output for processing algorithms, where layers may be either vector or raster.

QgsProcessingOutputMultipleLayers

A multi-layer output for processing algorithms which create map layers, when the number and nature of the output layers is not predefined.

QgsProcessingOutputNumber

A numeric output for processing algorithms.

QgsProcessingOutputPointCloudLayer

A pointcloud layer output for processing algorithms.

QgsProcessingOutputRasterLayer

A raster layer output for processing algorithms.

QgsProcessingOutputString

A string output for processing algorithms.

QgsProcessingOutputVariant

A variant output for processing algorithms, capable of storing any QVariant value.

QgsProcessingOutputVectorLayer

A vector layer output for processing algorithms.

QgsProcessingOutputVectorTileLayer

A vector tile layer output for processing algorithms.

Abstract Methods

type

Unique output type name.

Methods

autoCreated

Returns True if the output was automatically created when adding a parameter.

description

Returns the description for the output.

name

Returns the name of the output.

setAutoCreated

Sets whether an output was automatically created when adding a parameter.

setDescription

Sets the description for the output.

setName

Sets the name of the output.

Virtual Methods

In PyQGIS, only methods marked as virtual can be safely overridden in a Python subclass of QgsProcessingOutputDefinition. See the FAQ for more details.

valueAsFormattedString

Returns a HTML string version of the parameter output value (if possible).

valueAsString

Returns a string version of the parameter output value (if possible).

class qgis.core.QgsProcessingOutputDefinition[source]

Bases: object

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

Constructor for QgsProcessingOutputDefinition.

Parameters:
  • name (Optional[str])

  • description (Optional[str] = '')

__init__(a0: QgsProcessingOutputDefinition)
Parameters:

a0 (QgsProcessingOutputDefinition)

autoCreated(self) bool[source]

Returns True if the output was automatically created when adding a parameter.

See also

setAutoCreated()

Added in version 3.14.

Return type:

bool

description(self) str[source]

Returns the description for the output. This is the user-visible string used to identify this output.

See also

setDescription()

Return type:

str

name(self) str[source]

Returns the name of the output. This is the internal identifier by which algorithms access this output.

See also

setName()

Return type:

str

setAutoCreated(self, autoCreated: bool)[source]

Sets whether an output was automatically created when adding a parameter.

Parameters:

autoCreated (bool) – set to True if the output is to be considered as automatically created.

See also

autoCreated()

Added in version 3.14.

setDescription(self, description: str | None)[source]

Sets the description for the output. This is the user-visible string used to identify this output.

See also

description()

Parameters:

description (Optional[str])

setName(self, name: str | None)[source]

Sets the name of the output. This is the internal identifier by which algorithms access this output.

See also

name()

Parameters:

name (Optional[str])

abstract type(self) str[source]

Unique output type name.

Return type:

str

virtual valueAsFormattedString(self, value: Any, context: QgsProcessingContext)[source]

Returns a HTML string version of the parameter output value (if possible).

By default this will return the same value as valueAsString().

Parameters:
Returns:

  • value converted to string

  • ok: True if value could be represented as a string.

See also

valueAsString()

Added in version 3.36.

virtual valueAsString(self, value: Any, context: QgsProcessingContext)[source]

Returns a string version of the parameter output value (if possible).

Parameters:
Returns:

  • value converted to string

  • ok: True if value could be represented as a string.

Added in version 3.36.