Class: QgsProcessingResultsHandler¶
Handles results output by Processing algorithms.
Warning
This is not considered stable API, and is exposed to Python for internal use only.
Added in version 4.4.
List of all members, including inherited members
Classes
Contains details of a layer result from running an algorithm. |
Methods
Handles the results from running an algorithm. |
Static Methods
Responsible for adding layers created by an algorithm to a project and the project's layer tree in the correct location. |
|
Applies post-processing steps to the |
|
Determines the desired layer name for a map layer output. |
|
Returns the destination layer tree group to store results in, or |
- class qgis.core.QgsProcessingResultsHandler[source]¶
Bases:
object- class ResultLayerDetails[source]¶
Bases:
objectContains details of a layer result from running an algorithm.
Added in version 4.4.
- __init__(layer: QgsMapLayer | None)¶
Constructor for ResultLayerDetails.
Takes ownership of
layer.- Parameters:
layer (QgsMapLayer|None)
- __init__(a0: QgsProcessingResultsHandler.ResultLayerDetails)
- Parameters:
- destinationProject: QgsProject¶
- layer: QgsMapLayer¶
- sortKey: int¶
- targetLayerTreeGroup: QgsLayerTreeGroup¶
- static addResultLayers(layers: Iterable[QgsProcessingResultsHandler.ResultLayerDetails], context: QgsProcessingContext, currentSelectedNode: QgsLayerTreeNode | None) QgsMapLayer | None[source]¶
Responsible for adding layers created by an algorithm to a project and the project’s layer tree in the correct location.
Returns the map layer which should be set as the project’s active layer after adding all the results.
- Parameters:
layers (Iterable[QgsProcessingResultsHandler.ResultLayerDetails])
context (QgsProcessingContext)
currentSelectedNode (QgsLayerTreeNode|None)
- Return type:
QgsMapLayer|None
- static configureResultLayerTreeLayer(layerTreeLayer: QgsLayerTreeLayer | None)[source]¶
Applies post-processing steps to the
QgsLayerTreeLayercreated for an algorithm’s output.- Parameters:
layerTreeLayer (QgsLayerTreeLayer|None)
- static determineOutputName(destinationId: str | None, details: QgsProcessingContext.LayerDetails, algorithm: QgsProcessingAlgorithm | None, context: QgsProcessingContext, parameters: dict[str | None, Any]) str[source]¶
Determines the desired layer name for a map layer output.
- Parameters:
destinationId (str|None)
details (QgsProcessingContext.LayerDetails)
algorithm (QgsProcessingAlgorithm|None)
context (QgsProcessingContext)
parameters (dict[str|None, Any])
- Return type:
str
- handleAlgorithmResults(self, algorithm: QgsProcessingAlgorithm | None, context: QgsProcessingContext, parameters: dict[str | None, Any], feedback: QgsProcessingFeedback | None = None) bool[source]¶
Handles the results from running an algorithm.
Returns
Trueif all results could be successfully loaded.- Parameters:
algorithm (QgsProcessingAlgorithm|None)
context (QgsProcessingContext)
parameters (dict[str|None, Any])
feedback (QgsProcessingFeedback|None = None)
- Return type:
bool
- static layerTreeResultsGroup(layerDetails: QgsProcessingContext.LayerDetails, context: QgsProcessingContext) QgsLayerTreeGroup | None[source]¶
Returns the destination layer tree group to store results in, or
Noneif there is no specific destination tree group associated with the layer.- Parameters:
layerDetails (QgsProcessingContext.LayerDetails)
context (QgsProcessingContext)
- Return type:
QgsLayerTreeGroup|None