22QString QgsCalculateExpressionAlgorithm::name()
const
24 return QStringLiteral(
"calculateexpression" );
27QgsProcessingAlgorithm::Flags QgsCalculateExpressionAlgorithm::flags()
const
29 return FlagHideFromToolbox | FlagSkipGenericModelLogging;
32QString QgsCalculateExpressionAlgorithm::displayName()
const
34 return QObject::tr(
"Calculate expression" );
37QStringList QgsCalculateExpressionAlgorithm::tags()
const
39 return QObject::tr(
"evaluate,variable,store" ).split(
',' );
42QString QgsCalculateExpressionAlgorithm::group()
const
44 return QObject::tr(
"Modeler tools" );
47QString QgsCalculateExpressionAlgorithm::groupId()
const
49 return QStringLiteral(
"modelertools" );
52QString QgsCalculateExpressionAlgorithm::shortHelpString()
const
54 return QObject::tr(
"This algorithm calculates the result of a QGIS expression and makes it available for use in other parts of the model." );
57QgsCalculateExpressionAlgorithm *QgsCalculateExpressionAlgorithm::createInstance()
const
59 return new QgsCalculateExpressionAlgorithm();
62void QgsCalculateExpressionAlgorithm::initAlgorithm(
const QVariantMap & )
66 std::unique_ptr< QgsProcessingParameterString > inputParameter = std::make_unique< QgsProcessingParameterString >( QStringLiteral(
"INPUT" ), QObject::tr(
"Input" ), QVariant(),
false,
false );
69 inputParameter->setMetadata(
72 QStringLiteral(
"model_widget" ),
80 addParameter( inputParameter.release() );
87 const QVariant res = parameters.value( QStringLiteral(
"INPUT" ) );
90 outputs.insert( QStringLiteral(
"OUTPUT" ), res );
@ Expression
Parameter value is taken from an expression, evaluated just before the algorithm runs.
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.