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
Creates a new parameter using the definition from a script code.
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.Returns the type name for the parameter class.
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
-
parentLayoutParameterName
(self) → str¶ Returns the name of the parent layout parameter, or an empty string if this is not set.
See also
-
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
-
setParentLayoutParameterName
(self, name: str)¶ Sets the
name
of the parent layout parameter. Use an empty string if this is not required.See also
-
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¶
-