Class: QgsProcessingParameterLayoutItem¶
- class qgis.core.QgsProcessingParameterLayoutItem¶
Bases:
QgsProcessingParameterDefinition
A print layout item parameter, allowing users to select a particular item from a print layout.
QgsProcessingParameterLayoutItem
should be evaluated by callingQgsProcessingAlgorithm.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.
QgsProcessingParameterLayoutItem(name: str, description: str = ‘’, defaultValue: Any = None, parentLayoutParameterName: str = ‘’, itemType: int = -1, optional: bool = False) Constructor for QgsProcessingParameterLayoutItem.
QgsProcessingParameterLayoutItem(
QgsProcessingParameterLayoutItem
)Methods
- param outputType:
- rtype:
str
- rtype:
QgsProcessingParameterDefinition
Default gui value for an algorithm parameter from settings
- rtype:
List[str]
Creates a new parameter using the definition from a script code.
- param map:
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.- rtype:
Dict[str, Any]
- rtype:
str
Returns the type name for the parameter class.
- param value:
- asPythonString(self, outputType: QgsProcessing.PythonOutputType = QgsProcessing.PythonOutputType.PythonQgsProcessingAlgorithmSubclass) str ¶
- Parameters:
outputType (QgsProcessing.PythonOutputType = QgsProcessing.PythonOutputType.PythonQgsProcessingAlgorithmSubclass) –
- Return type:
str
- asScriptCode(self) str ¶
- Return type:
str
- clone(self) QgsProcessingParameterDefinition ¶
- Return type:
- 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.
- dependsOnOtherParameters(self) List[str] ¶
- Return type:
List[str]
- fromScriptCode(name: str, description: str, isOptional: bool, definition: str) QgsProcessingParameterLayoutItem ¶
Creates a new parameter using the definition from a script code.
- Parameters:
name (str) –
description (str) –
isOptional (bool) –
definition (str) –
- Return type:
- fromVariantMap(self, map: Dict[str, Any]) bool ¶
- Parameters:
map (Dict[str) –
- Return type:
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
- Return type:
int
- parentLayoutParameterName(self) str ¶
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)¶
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) –
- setParentLayoutParameterName(self, name: str)¶
Sets the
name
of the parent layout parameter. Use an empty string if this is not required.See also
- Parameters:
name (str) –
- toVariantMap(self) Dict[str, Any] ¶
- Return type:
Dict[str, Any]
- 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:
value (Any) –
context (QgsProcessingContext) –
- Return type:
str