QgsProcessingDestinationParameter class
Base class for all parameter definitions which represent file or layer destinations, e.g.
Contents
parameters which are used for the destination for layers output by an algorithm.
Base classes
- class QgsProcessingParameterDefinition
- Base class for the definition of processing parameters.
Derived classes
- class QgsProcessingParameterFeatureSink
- A feature sink output for processing algorithms.
- class QgsProcessingParameterFileDestination
- A generic file based destination parameter, for specifying the destination path for a file (non-map layer) created by the algorithm.
- class QgsProcessingParameterFolderDestination
- A folder destination parameter, for specifying the destination path for a folder created by the algorithm or used for creating new files within the algorithm.
- class QgsProcessingParameterRasterDestination
- A raster layer destination parameter, for specifying the destination path for a raster layer created by the algorithm.
- class QgsProcessingParameterVectorDestination
- A vector layer destination parameter, for specifying the destination path for a vector layer created by the algorithm.
Constructors, destructors, conversion operators
- QgsProcessingDestinationParameter(const QString& name, const QString& description = QString(), const QVariant& defaultValue = QVariant(), bool optional = false, bool createByDefault = true)
- Constructor for QgsProcessingDestinationParameter.
Public functions
- auto createByDefault() const -> bool
- Returns true if the destination should be created by default.
- auto defaultFileExtension() const -> QString pure virtual
- Returns the default file extension for destination file paths associated with this parameter.
- auto fromVariantMap(const QVariantMap& map) -> bool override
- Restores this parameter to a QVariantMap.
- auto generateTemporaryDestination() const -> QString virtual
- Generates a temporary destination value for this parameter.
- auto isDestination() const -> bool override
- Returns true if this parameter represents a file or layer destination, e.g.
- void setCreateByDefault(bool createByDefault)
- Sets whether the destination should be created by default.
- void setSupportsNonFileBasedOutput(bool supportsNonFileBasedOutput)
- Sets whether the destination parameter supports non filed-based outputs, such as memory layers or direct database outputs.
- auto supportsNonFileBasedOutput() const -> bool
- Returns true if the destination parameter supports non filed-based outputs, such as memory layers or direct database outputs.
- auto toOutputDefinition() const -> QgsProcessingOutputDefinition* pure virtual
- Returns a new QgsProcessingOutputDefinition corresponding to the definition of the destination parameter.
- auto toVariantMap() const -> QVariantMap override
- Saves this parameter to a QVariantMap.
Protected functions
- auto originalProvider() const -> QgsProcessingProvider*
- Original (source) provider which this parameter has been derived from.
Function documentation
QgsProcessingDestinationParameter:: QgsProcessingDestinationParameter(const QString& name,
const QString& description = QString(),
const QVariant& defaultValue = QVariant(),
bool optional = false,
bool createByDefault = true)
Constructor for QgsProcessingDestinationParameter.
If createByDefault is false and the parameter is optional, then the destination output will not be created by default.
bool QgsProcessingDestinationParameter:: createByDefault() const
Returns true if the destination should be created by default.
For optional parameters, a return value of false indicates that the destination should not be created by default.
bool QgsProcessingDestinationParameter:: fromVariantMap(const QVariantMap& map) override
Restores this parameter to a QVariantMap.
Subclasses should ensure that they call the base class method.
QString QgsProcessingDestinationParameter:: generateTemporaryDestination() const virtual
Generates a temporary destination value for this parameter.
The returned value will be a file path or QGIS data provider URI suitable for temporary storage of created layers and files.
bool QgsProcessingDestinationParameter:: isDestination() const override
Returns true if this parameter represents a file or layer destination, e.g.
parameters which are used for the destination for layers output by an algorithm will return true.
void QgsProcessingDestinationParameter:: setCreateByDefault(bool createByDefault)
Sets whether the destination should be created by default.
For optional parameters, a value of false indicates that the destination should not be created by default.
void QgsProcessingDestinationParameter:: setSupportsNonFileBasedOutput(bool supportsNonFileBasedOutput)
Sets whether the destination parameter supports non filed-based outputs, such as memory layers or direct database outputs.
bool QgsProcessingDestinationParameter:: supportsNonFileBasedOutput() const
Returns true if the destination parameter supports non filed-based outputs, such as memory layers or direct database outputs.
QVariantMap QgsProcessingDestinationParameter:: toVariantMap() const override
Saves this parameter to a QVariantMap.
Subclasses should ensure that they call the base class method and then extend the result with additional properties.
QgsProcessingProvider* QgsProcessingDestinationParameter:: originalProvider() const protected
Original (source) provider which this parameter has been derived from.
In the case of destination parameters which are part of model algorithms, this will reflect the child algorithm's provider which actually generates the parameter, as opposed to the provider which this parameter belongs to (i.e. the model provider)