24QString QgsSetProjectVariableAlgorithm::name()
const
26 return QStringLiteral(
"setprojectvariable" );
36QString QgsSetProjectVariableAlgorithm::displayName()
const
38 return QObject::tr(
"Set project variable" );
41QStringList QgsSetProjectVariableAlgorithm::tags()
const
43 return QObject::tr(
"expression" ).split(
',' );
46QString QgsSetProjectVariableAlgorithm::group()
const
48 return QObject::tr(
"Modeler tools" );
51QString QgsSetProjectVariableAlgorithm::groupId()
const
53 return QStringLiteral(
"modelertools" );
56QString QgsSetProjectVariableAlgorithm::shortDescription()
const
58 return QObject::tr(
"Sets an expression variable for the current project." );
61QString QgsSetProjectVariableAlgorithm::shortHelpString()
const
63 return QObject::tr(
"This algorithm sets an expression variable for the current project." );
66QgsSetProjectVariableAlgorithm *QgsSetProjectVariableAlgorithm::createInstance()
const
68 return new QgsSetProjectVariableAlgorithm();
74 const QString name = parameterAsString( parameters, QStringLiteral(
"NAME" ), context );
75 const QString value = parameterAsString( parameters, QStringLiteral(
"VALUE" ), context );
81 feedback->
pushInfo( QObject::tr(
"Set variable \'%1\' to \'%2\'" ).arg( name, value ) );
86void 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.