Subgroup: Processing

Class: QgsProcessingParameterFile

class qgis.core.QgsProcessingParameterFile

Bases: qgis._core.QgsProcessingParameterDefinition

An input file or folder parameter for processing algorithms.

New in version 3.0: Methods

algorithm Returns a pointer to the algorithm which owns this parameter.
asScriptCode
behavior Returns the parameter behavior (e.g.
checkValueIsAcceptable
clone
defaultValue Returns the default value for the parameter.
dependsOnOtherParameters Returns a list of other parameter names on which this parameter is dependent (e.g.
description Returns the description for the parameter.
dynamicLayerParameterName Returns the name of the parameter for a layer linked to a dynamic parameter, or an empty string if this is not set.
dynamicPropertyDefinition Returns the property definition for dynamic properties.
extension Returns any specified file extension for the parameter.
flags Returns any flags associated with the parameter.
fromScriptCode Creates a new parameter using the definition from a script code.
fromVariantMap
isDestination Returns true if this parameter represents a file or layer destination, e.g.
isDynamic Returns true if the parameter supports is dynamic, and can support data-defined values (i.e.
metadata Returns the parameter’s freeform metadata.
name Returns the name of the parameter.
provider Returns a pointer to the provider for the algorithm which owns this parameter.
setBehavior Sets the parameter behavior (e.g.
setDefaultValue Sets the default value for the parameter.
setDescription Sets the description for the parameter.
setDynamicLayerParameterName Sets the name for the parameter for a layer linked to a dynamic parameter, or an empty string if this is not set.
setDynamicPropertyDefinition Sets the property definition for dynamic properties.
setExtension Sets a file extension for the parameter.
setFlags Sets the flags associated with the parameter.
setIsDynamic Sets whether the parameter is dynamic, and can support data-defined values (i.e.
setMetadata Sets the parameter’s freeform metadata.
setName Sets the name of the parameter.
toVariantMap
toolTip Returns a formatted tooltip for use with the parameter, which gives helpful information like parameter description, ID, and extra content like default values (depending on parameter type).
type
typeName Returns the type name for the parameter class.
valueAsPythonString 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.

Attributes

File
FlagAdvanced
FlagHidden
FlagOptional
Folder
class Behavior

Bases: int

File = 0
Folder = 1
asScriptCode(self) → str
behavior(self) → QgsProcessingParameterFile.Behavior

Returns the parameter behavior (e.g. File or Folder).

See also

setBehavior()

checkValueIsAcceptable(self, input: Any, context: QgsProcessingContext = None) → bool
clone(self) → QgsProcessingParameterDefinition
extension(self) → str

Returns any specified file extension for the parameter.

See also

setExtension()

fromScriptCode(name: str, description: str, isOptional: bool, definition: str, behavior: QgsProcessingParameterFile.Behavior = QgsProcessingParameterFile.File) → QgsProcessingParameterFile

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

fromVariantMap(self, map: Dict[str, Any]) → bool
setBehavior(self, behavior: QgsProcessingParameterFile.Behavior)

Sets the parameter behavior (e.g. File or Folder).

See also

behavior()

setExtension(self, extension: str)

Sets a file extension for the parameter.

See also

extension()

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

Returns the type name for the parameter class.