Class: QgsProcessingParameterLayoutItem

class qgis.core.QgsProcessingParameterLayoutItem(name: str, description: str = '', defaultValue: Any = None, parentLayoutParameterName: str = '', itemType: int = -1, optional: bool = False)

Bases: qgis._core.QgsProcessingParameterDefinition

Constructor for QgsProcessingParameterLayoutItem.

QgsProcessingParameterLayoutItem(QgsProcessingParameterLayoutItem)

A print layout item parameter, allowing users to select a particular item from a print layout.

QgsProcessingParameterLayoutItem should be evaluated by calling QgsProcessingAlgorithm.parameterAsLayoutItem() Internally, QgsProcessingParameterLayoutItems are string parameters, storing references to items either by their UUID (QgsLayoutItem.uuid()) or ID (QgsLayoutItem.id()).

New in version 3.8: Enums

Methods

asPythonString

asScriptCode

clone

dependsOnOtherParameters

fromScriptCode

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

fromVariantMap

itemType

Returns the acceptable item type, or -1 if any item type is allowed.

parentLayoutParameterName

Returns the name of the parent layout parameter, or an empty string if this is not set.

setItemType

Sets the acceptable item type, or -1 if any item type is allowed.

setParentLayoutParameterName

Sets the name of the parent layout parameter.

toVariantMap

type

typeName

Returns the type name for the parameter class.

valueAsPythonString

Signals

Attributes

asPythonString(self, outputType: QgsProcessing.PythonOutputType = QgsProcessing.PythonQgsProcessingAlgorithmSubclass) → str
asScriptCode(self) → str
clone(self) → QgsProcessingParameterDefinition
dependsOnOtherParameters(self) → List[str]
fromScriptCode(name: str, description: str, isOptional: bool, definition: str) → QgsProcessingParameterLayoutItem

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

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

Returns the acceptable item type, or -1 if any item type is allowed.

These values correspond to the registered item types from QgsLayoutItemRegistry.

See also

setItemType()

parentLayoutParameterName(self) → str

Returns the name of the parent layout parameter, or an empty string if this is not set.

setItemType(self, type: int)

Sets the acceptable item type, or -1 if any item type is allowed.

These values correspond to the registered item types from QgsLayoutItemRegistry.

See also

itemType()

setParentLayoutParameterName(self, name: str)

Sets the name of the parent layout parameter. Use an empty string if this is not required.

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

Returns the type name for the parameter class.

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