QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
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
 
 LayerDetails (const QString &name, QgsProject *project, const QString &outputName=QString(), QgsProcessingUtils::LayerHint layerTypeHint=QgsProcessingUtils::LayerHint::UnknownType)
 Constructor for LayerDetails.
 
QgsProcessingLayerPostProcessorInterfacepostProcessor () const
 Layer post-processor.
 
void setOutputLayerName (QgsMapLayer *layer) const
 Sets a layer name to match this output, respecting any local user settings which affect this name.
 
void setPostProcessor (QgsProcessingLayerPostProcessorInterface *processor)
 Sets the layer post-processor.
 

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.
 
QString groupName
 Optional name for a layer tree group under which to place the layer when loading it into a project.
 
int layerSortKey = 0
 Optional sorting key for sorting output layers when loading them into a project.
 
QgsProcessingUtils::LayerHint layerTypeHint = QgsProcessingUtils::LayerHint::UnknownType
 Layer type hint.
 
QString name
 Friendly name for layer, possibly for use when loading layer into project.
 
QString outputName
 Associated output name from algorithm which generated the layer.
 
QgsProjectproject = nullptr
 Destination project.
 

Detailed Description

Details for layers to load into projects.

Definition at line 247 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 254 of file qgsprocessingcontext.h.

◆ LayerDetails() [2/2]

QgsProcessingContext::LayerDetails::LayerDetails ( )
default

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 264 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 277 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 269 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 276 of file qgsprocessingcontext.h.

◆ groupName

QString QgsProcessingContext::LayerDetails::groupName

Optional name for a layer tree group under which to place the layer when loading it into a project.

Since
QGIS 3.32

Definition at line 288 of file qgsprocessingcontext.h.

◆ layerSortKey

int QgsProcessingContext::LayerDetails::layerSortKey = 0

Optional sorting key for sorting output layers when loading them into a project.

Layers with a greater sort key will be placed over layers with a lesser sort key.

Since
QGIS 3.32

Definition at line 297 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 269 of file qgsprocessingcontext.h.

◆ outputName

QString QgsProcessingContext::LayerDetails::outputName

Associated output name from algorithm which generated the layer.

Definition at line 281 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: