Class: QgsProcessingLayerPostProcessorInterface¶
An interface for layer post-processing handlers for execution following a processing algorithm operation.
Note that post-processing of a layer will ONLY occur if that layer is
set to be loaded into a QGIS project on algorithm completion. See
QgsProcessingContext.layersToLoadOnCompletion()
.
Algorithms that wish to set post-processing steps for generated layers should implement this interface in a separate class (NOT the algorithm class itself!).
Added in version 3.2.
Note
This is an abstract class, with methods which must be implemented by a subclass.
The following methods must be implemented: postProcessLayer()
Abstract Methods
Post-processes the specified layer, following successful execution of a processing algorithm. |
- class qgis.core.QgsProcessingLayerPostProcessorInterface[source]¶
Bases:
object
- abstract postProcessLayer(self, layer: QgsMapLayer | None, context: QgsProcessingContext, feedback: QgsProcessingFeedback | None)[source]¶
Post-processes the specified
layer
, following successful execution of a processing algorithm. This method always runs in the main thread and can be used to setup renderers, editor widgets, metadata, etc for the given layer.Post-processing classes can utilize settings from the algorithm’s
context
and report logging messages or errors via the givenfeedback
object.In the case of an algorithm run as part of a larger model, the post-processing occurs following the completed execution of the entire model.
Note that post-processing of a layer will ONLY occur if that layer is set to be loaded into a QGIS project on algorithm completion. See
QgsProcessingContext.layersToLoadOnCompletion()
.- Parameters:
layer (Optional[QgsMapLayer])
context (QgsProcessingContext)
feedback (Optional[QgsProcessingFeedback])