22using namespace Qt::StringLiterals;
26QString QgsCalculateExpressionAlgorithm::name()
const
28 return u
"calculateexpression"_s;
36QString QgsCalculateExpressionAlgorithm::displayName()
const
38 return QObject::tr(
"Calculate expression" );
41QStringList QgsCalculateExpressionAlgorithm::tags()
const
43 return QObject::tr(
"evaluate,variable,store" ).split(
',' );
46QString QgsCalculateExpressionAlgorithm::group()
const
48 return QObject::tr(
"Modeler tools" );
51QString QgsCalculateExpressionAlgorithm::groupId()
const
53 return u
"modelertools"_s;
56QString QgsCalculateExpressionAlgorithm::shortHelpString()
const
58 return QObject::tr(
"This algorithm calculates the result of a QGIS expression and makes it available for use in other parts of the model." );
61QString QgsCalculateExpressionAlgorithm::shortDescription()
const
63 return QObject::tr(
"Calculates the result of a QGIS expression and makes it available for use in other parts of the model." );
66QgsCalculateExpressionAlgorithm *QgsCalculateExpressionAlgorithm::createInstance()
const
68 return new QgsCalculateExpressionAlgorithm();
71void QgsCalculateExpressionAlgorithm::initAlgorithm(
const QVariantMap & )
75 auto inputParameter = std::make_unique<QgsProcessingParameterString>( u
"INPUT"_s, QObject::tr(
"Input" ), QVariant(),
false,
false );
78 inputParameter->setMetadata(
82 addParameter( inputParameter.release() );
89 const QVariant res = parameters.value( u
"INPUT"_s );
92 outputs.insert( u
"OUTPUT"_s, res );
QFlags< ProcessingAlgorithmFlag > ProcessingAlgorithmFlags
Flags indicating how and when an algorithm operates and should be exposed to users.
@ Expression
Parameter value is taken from an expression, evaluated just before the algorithm runs.
@ HideFromToolbox
Algorithm should be hidden from the toolbox.
@ SkipGenericModelLogging
When running as part of a model, the generic algorithm setup and results logging should be skipped.
Contains information about the context in which a processing algorithm is executed.
Base class for providing feedback from a processing algorithm.
A variant output for processing algorithms, capable of storing any QVariant value.