Class: QgsProcessingParameterBoolean

class qgis.core.QgsProcessingParameterBoolean

Bases: QgsProcessingParameterDefinition

A boolean parameter for processing algorithms.

QgsProcessingParameterBoolean(name: str, description: str = ‘’, defaultValue: Any = None, optional: bool = False) Constructor for QgsProcessingParameterBoolean.

QgsProcessingParameterBoolean(QgsProcessingParameterBoolean)

Methods

asScriptCode

rtype:

str

clone

rtype:

QgsProcessingParameterDefinition

defaultGuiValueFromSetting

Default gui value for an algorithm parameter from settings

fromScriptCode

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

type

rtype:

str

typeName

Returns the type name for the parameter class.

valueAsPythonString

param value:

asScriptCode(self) str
Return type:

str

clone(self) QgsProcessingParameterDefinition
Return type:

QgsProcessingParameterDefinition

defaultGuiValueFromSetting(self) Any

Default gui value for an algorithm parameter from settings

Returns:

default value from settings or invalid QVariant if there is no default value defined in the settings

New in version 3.34.

fromScriptCode(name: str, description: str, isOptional: bool, definition: str) QgsProcessingParameterBoolean

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

Parameters:
  • name (str) –

  • description (str) –

  • isOptional (bool) –

  • definition (str) –

Return type:

QgsProcessingParameterBoolean

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