Class: QgsProcessingParameterFileDestination

class qgis.core.QgsProcessingParameterFileDestination(name: str, description: str = '', fileFilter: str = '', defaultValue: Any = None, optional: bool = False, createByDefault: bool = True)

Bases: QgsProcessingDestinationParameter

Constructor for QgsProcessingParameterFileDestination.

If createByDefault is False and the parameter is optional, then this destination output will not be created by default.

QgsProcessingParameterFileDestination(QgsProcessingParameterFileDestination)

A generic file based destination parameter, for specifying the destination path for a file (non-map layer) created by the algorithm.

New in version 3.0.

Parameters
  • name (str) –

  • description (str = '') –

  • fileFilter (str = '') –

  • defaultValue (Any = None) –

  • optional (bool = False) –

  • createByDefault

asPythonString(self, outputType: QgsProcessing.PythonOutputType = QgsProcessing.PythonQgsProcessingAlgorithmSubclass) → str
Parameters

outputType (QgsProcessing.PythonOutputType = QgsProcessing.PythonQgsProcessingAlgorithmSubclass) –

Return type

str

checkValueIsAcceptable(self, input: Any, context: QgsProcessingContext = None) → bool
Parameters
Return type

bool

clone(self) → QgsProcessingParameterDefinition
Return type

QgsProcessingParameterDefinition

defaultFileExtension(self) → str
Return type

str

fileFilter(self) → str

Returns the file filter string for file destinations compatible with this parameter.

See also

setFileFilter()

Return type

str

fromScriptCode(name: str, description: str, isOptional: bool, definition: str) → QgsProcessingParameterFileDestination

Creates a new parameter using the definition from a script code.

Parameters
  • name (str) –

  • description (str) –

  • isOptional (bool) –

  • definition (str) –

Return type

QgsProcessingParameterFileDestination

fromVariantMap(self, map: Dict[str, Any]) → bool
Parameters

map (Dict[str) –

Return type

bool

originalProvider()
setFileFilter(self, filter: str)

Sets the file filter string for file destinations compatible with this parameter.

See also

fileFilter()

Parameters

filter (str) –

toOutputDefinition(self) → QgsProcessingOutputDefinition
Return type

QgsProcessingOutputDefinition

toVariantMap(self) → Dict[str, Any]
Return type

Dict[str, Any]

type(self) → str
Return type

str

typeName() → str

Returns the type name for the parameter class.

Return type

str

valueAsPythonString(self, value: Any, context: QgsProcessingContext) → str
Parameters
Return type

str