Class: QgsProcessingModelChildParameterSource¶
- class qgis.core.QgsProcessingModelChildParameterSource¶
Bases:
sip.wrapper
Source for the value of a parameter for a child algorithm within a model.
New in version 3.0.
QgsProcessingModelChildParameterSource() Constructor for
QgsProcessingModelChildParameterSource
. It is recommended that the static methodsfromStaticValue()
,fromModelParameter()
,fromChildOutput()
andfromExpression()
are used instead.QgsProcessingModelChildParameterSource(
QgsProcessingModelChildParameterSource
)Methods
Attempts to convert the source to executable Python code.
Returns an explanatory Python comment for the source, or an empty string if no comment is available.
Returns the source's expression.
Returns the source's text with expressions.
Returns a user-friendly identifier for this source, given the context of the specified
model
.Returns a new
QgsProcessingModelChildParameterSource
which takes its value from an output generated by a child algorithm.Returns a new
QgsProcessingModelChildParameterSource
which takes its value from an expression.Returns a new
QgsProcessingModelChildParameterSource
which takes its value from a text with expressions.Returns a new
QgsProcessingModelChildParameterSource
which takes its value from a parent model parameter.Returns a new
QgsProcessingModelChildParameterSource
which takes its value from a staticvalue
.Loads this source from a QVariantMap.
Returns the source's child algorithm ID from which the output value will be taken.
Returns the source's child algorithm output name from which the output value will be taken.
Returns the source's model parameter name.
Sets the source's expression.
Sets the source's text containing expressions.
Sets the source's child algorithm
id
from which the output value will be taken.Sets the source's child algorithm output
name
from which the output value will be taken.Sets the source's model parameter
name
.Sets the parameter's source.
Sets the source's static value.
Returns the parameter value's source.
Returns the source's static value.
Saves this source to a QVariant.
Attributes
- ChildOutput = 1¶
- Expression = 3¶
- ExpressionText = 4¶
- ModelOutput = 5¶
- ModelParameter = 0¶
- class Source¶
Bases:
int
- StaticValue = 2¶
- asPythonCode(self, outputType: QgsProcessing.PythonOutputType, definition: QgsProcessingParameterDefinition, friendlyChildNames: Dict[str, str]) str ¶
Attempts to convert the source to executable Python code.
The
friendlyChildNames
argument gives a map of child id to a friendly algorithm name, to be used in the code to identify that algorithm instead of the raw child id.- Parameters
outputType (QgsProcessing.PythonOutputType) –
definition (QgsProcessingParameterDefinition) –
friendlyChildNames (Dict[str) –
- Return type
str
- asPythonComment(self, definition: QgsProcessingParameterDefinition) str ¶
Returns an explanatory Python comment for the source, or an empty string if no comment is available.
New in version 3.20.
- Parameters
definition (QgsProcessingParameterDefinition) –
- Return type
str
- expression(self) str ¶
Returns the source’s expression. This is only used when the
source()
is Expression.See also
- Return type
str
- expressionText(self) str ¶
Returns the source’s text with expressions. This is only used when the
source()
is ExpressionText.See also
New in version 3.2.
- Return type
str
- friendlyIdentifier(self, model: QgsProcessingModelAlgorithm) str ¶
Returns a user-friendly identifier for this source, given the context of the specified
model
.New in version 3.14.
- Parameters
model (QgsProcessingModelAlgorithm) –
- Return type
str
- fromChildOutput(childId: str, outputName: str) QgsProcessingModelChildParameterSource ¶
Returns a new
QgsProcessingModelChildParameterSource
which takes its value from an output generated by a child algorithm.See also
See also
See also
See also
- Parameters
childId (str) –
outputName (str) –
- Return type
- fromExpression(expression: str) QgsProcessingModelChildParameterSource ¶
Returns a new
QgsProcessingModelChildParameterSource
which takes its value from an expression. The expression is evaluated just before the child algorithm executes, and can use functions available in its expression context to include results calculated from the child algorithms already executed by the model.See also
See also
See also
See also
New in version 3.2.
- Parameters
expression (str) –
- Return type
- fromExpressionText(text: str) QgsProcessingModelChildParameterSource ¶
Returns a new
QgsProcessingModelChildParameterSource
which takes its value from a text with expressions. Expressions are evaluated just before the child algorithm executes, and can use functions available in its expression context to include results calculated from the child algorithms already executed by the model.See also
See also
See also
See also
New in version 3.2.
- Parameters
text (str) –
- Return type
- fromModelParameter(parameterName: str) QgsProcessingModelChildParameterSource ¶
Returns a new
QgsProcessingModelChildParameterSource
which takes its value from a parent model parameter.See also
See also
See also
See also
- Parameters
parameterName (str) –
- Return type
- fromStaticValue(value: Any) QgsProcessingModelChildParameterSource ¶
Returns a new
QgsProcessingModelChildParameterSource
which takes its value from a staticvalue
.See also
See also
See also
See also
- Parameters
value (Any) –
- Return type
- loadVariant(self, map: Dict[str, Any]) bool ¶
Loads this source from a QVariantMap.
See also
- Parameters
map (Dict[str) –
- Return type
bool
- outputChildId(self) str ¶
Returns the source’s child algorithm ID from which the output value will be taken. This is only used when the
source()
is ChildOutput.See also
See also
- Return type
str
- outputName(self) str ¶
Returns the source’s child algorithm output name from which the output value will be taken. This is only used when the
source()
is ChildOutput.See also
See also
- Return type
str
- parameterName(self) str ¶
Returns the source’s model parameter name. This is only used when the
source()
is ModelParameter.See also
- Return type
str
- setExpression(self, expression: str)¶
Sets the source’s expression. Calling this will also change the
source()
to Expression. The expression is evaluated just before the child algorithm executes, and can use functions available in its expression context to include results calculated from the child algorithms already executed by the model.See also
- Parameters
expression (str) –
- setExpressionText(self, text: str)¶
Sets the source’s text containing expressions. Calling this will also change the
source()
to ExpressionText. Expressions are evaluated just before the child algorithm executes, and can use functions available in its expression context to include results calculated from the child algorithms already executed by the model.See also
New in version 3.2.
- Parameters
text (str) –
- setOutputChildId(self, id: str)¶
Sets the source’s child algorithm
id
from which the output value will be taken. Calling this will also change thesource()
to ChildOutput.See also
See also
- Parameters
id (str) –
- setOutputName(self, name: str)¶
Sets the source’s child algorithm output
name
from which the output value will be taken. Calling this will also change thesource()
to ChildOutput.See also
See also
- Parameters
name (str) –
- setParameterName(self, name: str)¶
Sets the source’s model parameter
name
. Calling this will also change thesource()
to ModelParameter.See also
- Parameters
name (str) –
- setSource(self, source: QgsProcessingModelChildParameterSource.Source)¶
Sets the parameter’s source.
New in version 3.14.
- Parameters
- setStaticValue(self, value: Any)¶
Sets the source’s static value. Calling this will also change the
source()
to StaticValue.See also
- Parameters
value (Any) –
- source(self) QgsProcessingModelChildParameterSource.Source ¶
Returns the parameter value’s source.
- Return type
- staticValue(self) Any ¶
Returns the source’s static value. This is only used when the
source()
is StaticValue.See also
- Return type
Any
- toVariant(self) Any ¶
Saves this source to a QVariant.
See also
- Return type
Any