Subgroup: Processing

Class: QgsProcessingModelChildParameterSource

class qgis.core.QgsProcessingModelChildParameterSource

Bases: sip.wrapper

Constructor for QgsProcessingModelChildParameterSource. It is recommended that the static methods fromStaticValue(), fromModelParameter(), fromChildOutput() and fromExpression() are used instead.

QgsProcessingModelChildParameterSource(QgsProcessingModelChildParameterSource)

Source for the value of a parameter for a child algorithm within a model.

New in version 3.0: Methods

asPythonCode Attempts to convert the source to executable Python code.
expression Returns the source’s expression.
expressionText Returns the source’s text with expressions.
fromChildOutput Returns a new QgsProcessingModelChildParameterSource which takes its value from an output generated by a child algorithm.
fromExpression Returns a new QgsProcessingModelChildParameterSource which takes its value from an expression.
fromExpressionText Returns a new QgsProcessingModelChildParameterSource which takes its value from a text with expressions.
fromModelParameter Returns a new QgsProcessingModelChildParameterSource which takes its value from a parent model parameter.
fromStaticValue Returns a new QgsProcessingModelChildParameterSource which takes its value from a static value.
loadVariant Loads this source from a QVariantMap.
outputChildId Returns the source’s child algorithm ID from which the output value will be taken.
outputName Returns the source’s child algorithm output name from which the output value will be taken.
parameterName Returns the source’s model parameter name.
setExpression Sets the source’s expression.
setExpressionText Sets the source’s text containing expressions.
setOutputChildId Sets the source’s child algorithm id from which the output value will be taken.
setOutputName Sets the source’s child algorithm output name from which the output value will be taken.
setParameterName Sets the source’s model parameter name.
setStaticValue Sets the source’s static value.
source Returns the parameter value’s source.
staticValue Returns the source’s static value.
toVariant Saves this source to a QVariant.

Signals

Attributes

ChildOutput
Expression
ExpressionText
ModelParameter
StaticValue
ChildOutput = 1
Expression = 3
ExpressionText = 4
ModelParameter = 0
class Source

Bases: int

StaticValue = 2
asPythonCode(self) → str

Attempts to convert the source to executable Python code.

expression(self) → str

Returns the source’s expression. This is only used when the source() is Expression.

See also

setExpression()

expressionText(self) → str

Returns the source’s text with expressions. This is only used when the source() is ExpressionText.

New in version 3.2.

fromChildOutput(childId: str, outputName: str) → QgsProcessingModelChildParameterSource

Returns a new QgsProcessingModelChildParameterSource which takes its value from an output generated by a child algorithm.

See also

fromExpression()

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.

New in version 3.2.

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

fromExpression()

New in version 3.2.

fromModelParameter(parameterName: str) → QgsProcessingModelChildParameterSource

Returns a new QgsProcessingModelChildParameterSource which takes its value from a parent model parameter.

See also

fromExpression()

fromStaticValue(value: Any) → QgsProcessingModelChildParameterSource

Returns a new QgsProcessingModelChildParameterSource which takes its value from a static value.

See also

fromExpression()

loadVariant(self, map: Dict[str, Any]) → bool

Loads this source from a QVariantMap.

See also

toVariant()

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

outputName()

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

setOutputName()

See also

outputChildId()

parameterName(self) → str

Returns the source’s model parameter name. This is only used when the source() is ModelParameter.

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

expression()

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

expressionText()

New in version 3.2.

setOutputChildId(self, id: str)

Sets the source’s child algorithm id from which the output value will be taken. Calling this will also change the source() to ChildOutput.

See also

parameterName()

See also

setOutputName()

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 the source() to ChildOutput.

See also

outputName()

setParameterName(self, name: str)

Sets the source’s model parameter name. Calling this will also change the source() to ModelParameter.

See also

parameterName()

setStaticValue(self, value: Any)

Sets the source’s static value. Calling this will also change the source() to StaticValue.

See also

staticValue()

source(self) → QgsProcessingModelChildParameterSource.Source

Returns the parameter value’s source.

staticValue(self) → Any

Returns the source’s static value. This is only used when the source() is StaticValue.

See also

setStaticValue()

toVariant(self) → Any

Saves this source to a QVariant.

See also

loadVariant()