QGIS API Documentation 3.41.0-Master (45a0abf3bec)
|
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. | |
QgsProject * | destinationProject = nullptr |
Destination project. | |
QgsProperty | sink |
Sink/layer definition. | |
Encapsulates settings relating to a feature sink or output raster layer for a processing algorithm.
Definition at line 202 of file qgsprocessingparameters.h.
|
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 211 of file qgsprocessingparameters.h.
|
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 221 of file qgsprocessingparameters.h.
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.
Definition at line 90 of file qgsprocessingparameters.cpp.
|
inline |
Allows direct construction of QVariants.
Definition at line 297 of file qgsprocessingparameters.h.
bool QgsProcessingOutputLayerDefinition::operator!= | ( | const QgsProcessingOutputLayerDefinition & | other | ) | const |
Definition at line 112 of file qgsprocessingparameters.cpp.
bool QgsProcessingOutputLayerDefinition::operator== | ( | const QgsProcessingOutputLayerDefinition & | other | ) | const |
Definition at line 106 of file qgsprocessingparameters.cpp.
|
inline |
Returns the output remapping definition, if useRemapping() is true
.
Definition at line 266 of file qgsprocessingparameters.h.
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
.
Definition at line 74 of file qgsprocessingparameters.cpp.
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.
Definition at line 80 of file qgsprocessingparameters.cpp.
|
inline |
Returns true
if the output uses a remapping definition.
Definition at line 257 of file qgsprocessingparameters.h.
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 249 of file qgsprocessingparameters.h.
QString QgsProcessingOutputLayerDefinition::destinationName |
Name to use for sink if it's to be loaded into a destination project.
Definition at line 241 of file qgsprocessingparameters.h.
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 236 of file qgsprocessingparameters.h.
QgsProperty QgsProcessingOutputLayerDefinition::sink |
Sink/layer definition.
Usually a static property set to the destination file name for the sink's layer.
Definition at line 229 of file qgsprocessingparameters.h.