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 ); }
53 static QgsProcessingModelChildParameterSource fromStaticValue(
const QVariant &value );
62 static QgsProcessingModelChildParameterSource fromModelParameter(
const QString ¶meterName );
71 static QgsProcessingModelChildParameterSource fromChildOutput(
const QString &childId,
const QString &outputName );
84 static QgsProcessingModelChildParameterSource fromExpression(
const QString &expression );
98 static QgsProcessingModelChildParameterSource fromExpressionText(
const QString &text );
116 QVariant staticValue()
const {
return mStaticValue; }
122 void setStaticValue(
const QVariant &value )
124 mStaticValue = value;
132 QString parameterName()
const {
return mParameterName; }
138 void setParameterName(
const QString &name )
140 mParameterName = name;
149 QString outputChildId()
const {
return mChildId; }
156 void setOutputChildId(
const QString &
id )
167 QString outputName()
const {
return mOutputName; }
174 void setOutputName(
const QString &name )
184 QString expression()
const {
return mExpression; }
193 void setExpression(
const QString &expression )
195 mExpression = expression;
205 QString expressionText()
const {
return mExpressionText; }
216 void setExpressionText(
const QString &text )
218 mExpressionText = text;
226 QVariant toVariant()
const;
232 bool loadVariant(
const QVariantMap &map );
239 QString asPythonCode(
QgsProcessing::PythonOutputType outputType,
const QgsProcessingParameterDefinition *definition,
const QMap< QString, QString > &friendlyChildNames )
const;
246 QString asPythonComment(
const QgsProcessingParameterDefinition *definition )
const;
252 QString friendlyIdentifier( QgsProcessingModelAlgorithm *model )
const;
256 QVariant mStaticValue;
257 QString mParameterName;
261 QString mExpressionText;
265CORE_EXPORT QDataStream &
operator<<( QDataStream &out,
const QgsProcessingModelChildParameterSource &source );
266CORE_EXPORT QDataStream &
operator>>( QDataStream &in, QgsProcessingModelChildParameterSource &source );
270typedef 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)