23QString QgsSetProjectVariableAlgorithm::name()
const
25 return QStringLiteral(
"setprojectvariable" );
35QString QgsSetProjectVariableAlgorithm::displayName()
const
37 return QObject::tr(
"Set project variable" );
40QStringList QgsSetProjectVariableAlgorithm::tags()
const
42 return QObject::tr(
"expression" ).split(
',' );
45QString QgsSetProjectVariableAlgorithm::group()
const
47 return QObject::tr(
"Modeler tools" );
50QString QgsSetProjectVariableAlgorithm::groupId()
const
52 return QStringLiteral(
"modelertools" );
55QString QgsSetProjectVariableAlgorithm::shortDescription()
const
57 return QObject::tr(
"Sets an expression variable for the current project" );
60QString QgsSetProjectVariableAlgorithm::shortHelpString()
const
62 return QObject::tr(
"This algorithm sets an expression variable for the current project." );
65QgsSetProjectVariableAlgorithm *QgsSetProjectVariableAlgorithm::createInstance()
const
67 return new QgsSetProjectVariableAlgorithm();
73 const QString name = parameterAsString( parameters, QStringLiteral(
"NAME" ), context );
74 const QString value = parameterAsString( parameters, QStringLiteral(
"VALUE" ), context );
80 feedback->
pushInfo( QObject::tr(
"Set variable \'%1\' to \'%2\'" ).arg( name, value ) );
85void QgsSetProjectVariableAlgorithm::initAlgorithm(
const QVariantMap & )
QFlags< ProcessingAlgorithmFlag > ProcessingAlgorithmFlags
Flags indicating how and when an algorithm operates and should be exposed to users.
@ NotAvailableInStandaloneTool
Algorithm should not be available from the standalone "qgis_process" tool. Used to flag algorithms wh...
@ 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.
static void setProjectVariable(QgsProject *project, const QString &name, const QVariant &value)
Sets a project context variable.
Contains information about the context in which a processing algorithm is executed.
QgsProject * project() const
Returns the project in which the algorithm is being executed.
Custom exception class for processing related exceptions.
Base class for providing feedback from a processing algorithm.
virtual void pushInfo(const QString &info)
Pushes a general informational message from the algorithm.
A string parameter for processing algorithms.