QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
Public Member Functions | Public Attributes | List of all members
QgsProcessingContext::LayerDetails Class Reference

Details for layers to load into projects. More...

#include <qgsprocessingcontext.h>

Public Member Functions

 LayerDetails ()=default
 Default constructor. More...
 
 LayerDetails (const QString &name, QgsProject *project, const QString &outputName=QString(), QgsProcessingUtils::LayerHint layerTypeHint=QgsProcessingUtils::LayerHint::UnknownType)
 Constructor for LayerDetails. More...
 
QgsProcessingLayerPostProcessorInterfacepostProcessor () const
 Layer post-processor. More...
 
void setOutputLayerName (QgsMapLayer *layer) const
 Sets a layer name to match this output, respecting any local user settings which affect this name. More...
 
void setPostProcessor (QgsProcessingLayerPostProcessorInterface *processor)
 Sets the layer post-processor. More...
 

Public Attributes

bool forceName = false
 Set to true if LayerDetails::name should always be used as the loaded layer name, regardless of the user's local Processing settings. More...
 
QgsProcessingUtils::LayerHint layerTypeHint = QgsProcessingUtils::LayerHint::UnknownType
 Layer type hint. More...
 
QString name
 Friendly name for layer, possibly for use when loading layer into project. More...
 
QString outputName
 Associated output name from algorithm which generated the layer. More...
 
QgsProjectproject = nullptr
 Destination project. More...
 

Detailed Description

Details for layers to load into projects.

Since
QGIS 3.0

Definition at line 262 of file qgsprocessingcontext.h.

Constructor & Destructor Documentation

◆ LayerDetails() [1/2]

QgsProcessingContext::LayerDetails::LayerDetails ( const QString &  name,
QgsProject project,
const QString &  outputName = QString(),
QgsProcessingUtils::LayerHint  layerTypeHint = QgsProcessingUtils::LayerHint::UnknownType 
)
inline

Constructor for LayerDetails.

Definition at line 269 of file qgsprocessingcontext.h.

◆ LayerDetails() [2/2]

QgsProcessingContext::LayerDetails::LayerDetails ( )
default

Default constructor.

Member Function Documentation

◆ postProcessor()

QgsProcessingLayerPostProcessorInterface * QgsProcessingContext::LayerDetails::postProcessor ( ) const

Layer post-processor.

May be nullptr if no post-processing is required.

See also
setPostProcessor()
Since
QGIS 3.2

Definition at line 215 of file qgsprocessingcontext.cpp.

◆ setOutputLayerName()

void QgsProcessingContext::LayerDetails::setOutputLayerName ( QgsMapLayer layer) const

Sets a layer name to match this output, respecting any local user settings which affect this name.

Since
QGIS 3.10.1

Definition at line 228 of file qgsprocessingcontext.cpp.

◆ setPostProcessor()

void QgsProcessingContext::LayerDetails::setPostProcessor ( QgsProcessingLayerPostProcessorInterface processor)

Sets the layer post-processor.

May be nullptr if no post-processing is required.

Ownership of processor is transferred.

See also
postProcessor()
Since
QGIS 3.2

Definition at line 220 of file qgsprocessingcontext.cpp.

Member Data Documentation

◆ forceName

bool QgsProcessingContext::LayerDetails::forceName = false

Set to true if LayerDetails::name should always be used as the loaded layer name, regardless of the user's local Processing settings.

Since
QGIS 3.16

Definition at line 292 of file qgsprocessingcontext.h.

◆ layerTypeHint

QgsProcessingUtils::LayerHint QgsProcessingContext::LayerDetails::layerTypeHint = QgsProcessingUtils::LayerHint::UnknownType

Layer type hint.

Since
QGIS 3.4

Definition at line 304 of file qgsprocessingcontext.h.

◆ name

QString QgsProcessingContext::LayerDetails::name

Friendly name for layer, possibly for use when loading layer into project.

Warning
Instead of directly using this value, prefer to call setOutputLayerName() to generate a layer name which respects the user's local Processing settings.

Definition at line 285 of file qgsprocessingcontext.h.

◆ outputName

QString QgsProcessingContext::LayerDetails::outputName

Associated output name from algorithm which generated the layer.

Definition at line 297 of file qgsprocessingcontext.h.

◆ project

QgsProject* QgsProcessingContext::LayerDetails::project = nullptr

Destination project.

Definition at line 331 of file qgsprocessingcontext.h.


The documentation for this class was generated from the following files: