QgsProcessingParameterRasterDestination class
A raster layer destination parameter, for specifying the destination path for a raster layer created by the algorithm.
Contents
Base classes
- class QgsProcessingDestinationParameter
- Base class for all parameter definitions which represent file or layer destinations, e.g.
Public static functions
- static auto fromScriptCode(const QString& name, const QString& description, bool isOptional, const QString& definition) -> QgsProcessingParameterRasterDestination*
- Creates a new parameter using the definition from a script code.
- static auto typeName() -> QString
- Returns the type name for the parameter class.
Constructors, destructors, conversion operators
- QgsProcessingParameterRasterDestination(const QString& name, const QString& description = QString(), const QVariant& defaultValue = QVariant(), bool optional = false, bool createByDefault = true)
- Constructor for QgsProcessingParameterRasterDestination.
Public functions
- auto checkValueIsAcceptable(const QVariant& input, QgsProcessingContext* context = nullptr) const -> bool override
- Checks whether the specified input value is acceptable for the parameter.
- auto clone() const -> QgsProcessingParameterDefinition* override
- Creates a clone of the parameter definition.
- auto defaultFileExtension() const -> QString override
- Returns the default file extension for destination file paths associated with this parameter.
- auto supportedOutputRasterLayerExtensions() const -> QStringList virtual
- Returns a list of the raster format file extensions supported for this parameter.
- auto toOutputDefinition() const -> QgsProcessingOutputDefinition* override
- Returns a new QgsProcessingOutputDefinition corresponding to the definition of the destination parameter.
- auto type() const -> QString override
- Unique parameter type name.
- auto valueAsPythonString(const QVariant& value, QgsProcessingContext& context) const -> QString override
- Returns a string version of the parameter input value, which is suitable for use as an input parameter value when running an algorithm directly from a Python command.
Function documentation
QgsProcessingParameterRasterDestination:: QgsProcessingParameterRasterDestination(const QString& name,
const QString& description = QString(),
const QVariant& defaultValue = QVariant(),
bool optional = false,
bool createByDefault = true)
Constructor for QgsProcessingParameterRasterDestination.
If createByDefault is false and the parameter is optional, then this destination output will not be created by default.
bool QgsProcessingParameterRasterDestination:: checkValueIsAcceptable(const QVariant& input,
QgsProcessingContext* context = nullptr) const override
Checks whether the specified input value is acceptable for the parameter.
Returns true if the value can be accepted. The optional context parameter can be specified to allow a more stringent check to be performed, capable of checking for the presence of required layers and other factors within the context.
QStringList QgsProcessingParameterRasterDestination:: supportedOutputRasterLayerExtensions() const virtual
Returns a list of the raster format file extensions supported for this parameter.
QString QgsProcessingParameterRasterDestination:: valueAsPythonString(const QVariant& value,
QgsProcessingContext& context) const override
Returns a string version of the parameter input value, which is suitable for use as an input parameter value when running an algorithm directly from a Python command.
The returned value must be correctly escaped - e.g. string values must be wrapped in ' 's.