Class: QgsProcessingParameterFileDestination¶
A generic file based destination parameter, for specifying the destination path for a file (non-map layer) created by the algorithm.
In some circumstances it is desirable to avoid the usual file overwriting confirmation prompt when users select an existing destination file for this parameter type (e.g., for algorithms which append to an existing destination file instead of overwriting them.). This can be done by setting the widget wrapper metadata “dontconfirmoverwrite” option:
param = QgsProcessingParameterFileDestination( 'OUTPUT', 'Destination file')
# don't show the file overwrite warning when users select a destination file:
param.setMetadata( {'widget_wrapper':
{ 'dontconfirmoverwrite': True }
})
Class Hierarchy¶
Base classes¶
Base class for all parameter definitions which represent file or layer destinations, e.g. parameters which are used for the destination for layers output by an algorithm. |
|
Base class for the definition of processing parameters. |
|
Abstract interface for classes which generate a file filter string. |
Methods
Returns the file filter string for file destinations compatible with this parameter. |
|
Sets the file filter string for file destinations compatible with this parameter. |
Static Methods
Creates a new parameter using the definition from a script code. |
|
Returns the type name for the parameter class. |
- class qgis.core.QgsProcessingParameterFileDestination[source]¶
Bases:
QgsProcessingDestinationParameter
- __init__(name: str | None, description: str | None = '', fileFilter: str | None = '', defaultValue: Any = None, optional: bool = False, createByDefault: bool = True)
Constructor for QgsProcessingParameterFileDestination.
If
createByDefault
isFalse
and the parameter isoptional
, then this destination output will not be created by default.- Parameters:
name (Optional[str])
description (Optional[str] = '')
fileFilter (Optional[str] = '')
defaultValue (Any = None)
optional (bool = False)
createByDefault (bool = True)
- __init__(a0: QgsProcessingParameterFileDestination)
- Parameters:
- fileFilter(self) str [source]¶
Returns the file filter string for file destinations compatible with this parameter.
See also
- Return type:
str
- static fromScriptCode(name: str | None, description: str | None, isOptional: bool, definition: str | None) QgsProcessingParameterFileDestination | None [source]¶
Creates a new parameter using the definition from a script code.
- Parameters:
name (Optional[str])
description (Optional[str])
isOptional (bool)
definition (Optional[str])
- Return type:
Optional[QgsProcessingParameterFileDestination]