18#ifndef QGSPROCESSINGMODELCHILDPARAMETERSOURCE_H
19#define QGSPROCESSINGMODELCHILDPARAMETERSOURCE_H
26class QgsProcessingModelAlgorithm;
34class CORE_EXPORT QgsProcessingModelChildParameterSource
41 QgsProcessingModelChildParameterSource() =
default;
43 bool operator==(
const QgsProcessingModelChildParameterSource &other )
const;
44 bool operator!=(
const QgsProcessingModelChildParameterSource &other )
const {
return !
operator==( other ); }
52 static QgsProcessingModelChildParameterSource fromStaticValue(
const QVariant &value );
60 static QgsProcessingModelChildParameterSource fromModelParameter(
const QString ¶meterName );
68 static QgsProcessingModelChildParameterSource fromChildOutput(
const QString &childId,
const QString &outputName );
80 static QgsProcessingModelChildParameterSource fromExpression(
const QString &expression );
94 Q_DECL_DEPRECATED
static QgsProcessingModelChildParameterSource fromExpressionText(
const QString &text )
SIP_DEPRECATED;
112 QVariant staticValue()
const {
return mStaticValue; }
118 void setStaticValue(
const QVariant &value )
120 mStaticValue = value;
128 QString parameterName()
const {
return mParameterName; }
134 void setParameterName(
const QString &name )
136 mParameterName = name;
145 QString outputChildId()
const {
return mChildId; }
152 void setOutputChildId(
const QString &
id )
163 QString outputName()
const {
return mOutputName; }
170 void setOutputName(
const QString &name )
180 QString expression()
const {
return mExpression; }
189 void setExpression(
const QString &expression )
191 mExpression = expression;
201 Q_DECL_DEPRECATED QString expressionText() const
SIP_DEPRECATED {
return mExpressionText; }
212 Q_DECL_DEPRECATED
void setExpressionText(
const QString &text )
SIP_DEPRECATED
214 mExpressionText = text;
222 QVariant toVariant()
const;
228 bool loadVariant(
const QVariantMap &map );
235 QString asPythonCode(
QgsProcessing::PythonOutputType outputType,
const QgsProcessingParameterDefinition *definition,
const QMap< QString, QString > &friendlyChildNames )
const;
242 QString asPythonComment(
const QgsProcessingParameterDefinition *definition )
const;
248 QString friendlyIdentifier( QgsProcessingModelAlgorithm *model )
const;
252 QVariant mStaticValue;
253 QString mParameterName;
257 QString mExpressionText;
261CORE_EXPORT QDataStream &
operator<<( QDataStream &out,
const QgsProcessingModelChildParameterSource &source );
262CORE_EXPORT QDataStream &
operator>>( QDataStream &in, QgsProcessingModelChildParameterSource &source );
266typedef QList< QgsProcessingModelChildParameterSource > QgsProcessingModelChildParameterSources;
ProcessingModelChildParameterSource
Processing model child parameter sources.
@ ExpressionText
Parameter value is taken from a text with expressions, evaluated just before the algorithm runs.
@ ChildOutput
Parameter value is taken from an output generated by a child algorithm.
@ ModelParameter
Parameter value is taken from a parent model parameter.
@ StaticValue
Parameter value is a static value.
@ Expression
Parameter value is taken from an expression, evaluated just before the algorithm runs.
Base class for the definition of processing parameters.
PythonOutputType
Available Python output types.
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)
QDataStream & operator<<(QDataStream &out, const QgsFeature &feature)
Writes the feature to stream out. QGIS version compatibility is not guaranteed.
QDataStream & operator>>(QDataStream &in, QgsFeature &feature)
Reads a feature from stream in into feature. QGIS version compatibility is not guaranteed.
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)