QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
QgsProcessingOutputLayerDefinition Class Reference

Encapsulates settings relating to a feature sink or output raster layer for a processing algorithm. More...

#include <qgsprocessingparameters.h>

Public Member Functions

 QgsProcessingOutputLayerDefinition (const QgsProperty &sink, QgsProject *destinationProject=nullptr)
 Constructor for QgsProcessingOutputLayerDefinition, accepting a QgsProperty sink/layer.
 
 QgsProcessingOutputLayerDefinition (const QString &sink=QString(), QgsProject *destinationProject=nullptr)
 Constructor for QgsProcessingOutputLayerDefinition, accepting a static sink/layer string.
 
bool loadVariant (const QVariantMap &map)
 Loads this output layer definition from a QVariantMap, wrapped in a QVariant.
 
 operator QVariant () const
 Allows direct construction of QVariants.
 
bool operator!= (const QgsProcessingOutputLayerDefinition &other) const
 
bool operator== (const QgsProcessingOutputLayerDefinition &other) const
 
QgsRemappingSinkDefinition remappingDefinition () const
 Returns the output remapping definition, if useRemapping() is true.
 
void setRemappingDefinition (const QgsRemappingSinkDefinition &definition)
 Sets the remapping definition to use when adding features to the output layer.
 
QVariant toVariant () const
 Saves this output layer definition to a QVariantMap, wrapped in a QVariant.
 
bool useRemapping () const
 Returns true if the output uses a remapping definition.
 

Public Attributes

QVariantMap createOptions
 Map of optional sink/layer creation options, which are passed to the underlying provider when creating new layers.
 
QString destinationName
 Name to use for sink if it's to be loaded into a destination project.
 
QgsProjectdestinationProject = nullptr
 Destination project.
 
QgsProperty sink
 Sink/layer definition.
 

Detailed Description

Encapsulates settings relating to a feature sink or output raster layer for a processing algorithm.

Since
QGIS 3.0

Definition at line 217 of file qgsprocessingparameters.h.

Constructor & Destructor Documentation

◆ QgsProcessingOutputLayerDefinition() [1/2]

QgsProcessingOutputLayerDefinition::QgsProcessingOutputLayerDefinition ( const QString &  sink = QString(),
QgsProject destinationProject = nullptr 
)
inline

Constructor for QgsProcessingOutputLayerDefinition, accepting a static sink/layer string.

The destinationProject parameter can be set to a QgsProject instance in which to automatically load the resulting sink/layer after completing processing.

Definition at line 226 of file qgsprocessingparameters.h.

◆ QgsProcessingOutputLayerDefinition() [2/2]

QgsProcessingOutputLayerDefinition::QgsProcessingOutputLayerDefinition ( const QgsProperty sink,
QgsProject destinationProject = nullptr 
)
inline

Constructor for QgsProcessingOutputLayerDefinition, accepting a QgsProperty sink/layer.

The destinationProject parameter can be set to a QgsProject instance in which to automatically load the resulting sink/layer after completing processing.

Definition at line 236 of file qgsprocessingparameters.h.

Member Function Documentation

◆ loadVariant()

bool QgsProcessingOutputLayerDefinition::loadVariant ( const QVariantMap &  map)

Loads this output layer definition from a QVariantMap, wrapped in a QVariant.

You can use QgsXmlUtils::readVariant to load it from an XML document.

See also
toVariant()
Since
QGIS 3.2

Definition at line 89 of file qgsprocessingparameters.cpp.

◆ operator QVariant()

QgsProcessingOutputLayerDefinition::operator QVariant ( ) const
inline

Allows direct construction of QVariants.

Definition at line 312 of file qgsprocessingparameters.h.

◆ operator!=()

bool QgsProcessingOutputLayerDefinition::operator!= ( const QgsProcessingOutputLayerDefinition other) const

Definition at line 111 of file qgsprocessingparameters.cpp.

◆ operator==()

bool QgsProcessingOutputLayerDefinition::operator== ( const QgsProcessingOutputLayerDefinition other) const

Definition at line 105 of file qgsprocessingparameters.cpp.

◆ remappingDefinition()

QgsRemappingSinkDefinition QgsProcessingOutputLayerDefinition::remappingDefinition ( ) const
inline

Returns the output remapping definition, if useRemapping() is true.

See also
useRemapping()
setRemappingDefinition()
Since
QGIS 3.14

Definition at line 281 of file qgsprocessingparameters.h.

◆ setRemappingDefinition()

void QgsProcessingOutputLayerDefinition::setRemappingDefinition ( const QgsRemappingSinkDefinition definition)

Sets the remapping definition to use when adding features to the output layer.

Calling this method will set useRemapping() to true.

See also
remappingDefinition()
useRemapping()
Since
QGIS 3.14

Definition at line 73 of file qgsprocessingparameters.cpp.

◆ toVariant()

QVariant QgsProcessingOutputLayerDefinition::toVariant ( ) const

Saves this output layer definition to a QVariantMap, wrapped in a QVariant.

You can use QgsXmlUtils::writeVariant to save it to an XML document.

See also
loadVariant()
Since
QGIS 3.2

Definition at line 79 of file qgsprocessingparameters.cpp.

◆ useRemapping()

bool QgsProcessingOutputLayerDefinition::useRemapping ( ) const
inline

Returns true if the output uses a remapping definition.

See also
remappingDefinition()
Since
QGIS 3.14

Definition at line 272 of file qgsprocessingparameters.h.

Member Data Documentation

◆ createOptions

QVariantMap QgsProcessingOutputLayerDefinition::createOptions

Map of optional sink/layer creation options, which are passed to the underlying provider when creating new layers.

Known options also include 'fileEncoding', which is used to specify a file encoding to use for created files.

Definition at line 264 of file qgsprocessingparameters.h.

◆ destinationName

QString QgsProcessingOutputLayerDefinition::destinationName

Name to use for sink if it's to be loaded into a destination project.

Definition at line 256 of file qgsprocessingparameters.h.

◆ destinationProject

QgsProject* QgsProcessingOutputLayerDefinition::destinationProject = nullptr

Destination project.

Can be set to a QgsProject instance in which to automatically load the resulting sink/layer after completing processing. The default behavior is not to load the result into any project (nullptr).

Definition at line 251 of file qgsprocessingparameters.h.

◆ sink

QgsProperty QgsProcessingOutputLayerDefinition::sink

Sink/layer definition.

Usually a static property set to the destination file name for the sink's layer.

Definition at line 244 of file qgsprocessingparameters.h.


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