Class: 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()).
Added in version 3.8.
Class Hierarchy¶
Base classes¶
Base class for the definition of processing parameters. |
Methods
Returns the acceptable item type, or -1 if any item type is allowed. |
|
Returns the name of the parent layout parameter, or an empty string if this is not set. |
|
Sets the acceptable item type, or -1 if any item type is allowed. |
|
Sets the name of the parent layout 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.QgsProcessingParameterLayoutItem[source]¶
Bases:
QgsProcessingParameterDefinition- __init__(name: str | None, description: str | None = '', defaultValue: Any = None, parentLayoutParameterName: str | None = '', itemType: int = -1, optional: bool = False)
Constructor for QgsProcessingParameterLayoutItem.
- Parameters:
name (Optional[str])
description (Optional[str] = '')
defaultValue (Any = None)
parentLayoutParameterName (Optional[str] = '')
itemType (int = -1)
optional (bool = False)
- __init__(a0: QgsProcessingParameterLayoutItem)
- Parameters:
- static fromScriptCode(name: str | None, description: str | None, isOptional: bool, definition: str | None) QgsProcessingParameterLayoutItem | 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[QgsProcessingParameterLayoutItem]
- itemType(self) int[source]¶
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
- Return type:
int
- parentLayoutParameterName(self) str[source]¶
Returns the name of the parent layout parameter, or an empty string if this is not set.
See also
- Return type:
str
- setItemType(self, type: int)[source]¶
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
- Parameters:
type (int)