Skip to content

Class ExpressionContextUtils

ClassList > ExpressionContextUtils

Inherits the following classes: QObject

Public Functions

Type Name
ExpressionContextUtils (QObject * parent=nullptr)

Public Static Functions

Type Name
QgsExpressionContextScope * cloudUserScope (const CloudUserInformation & cloudUserInformation)
Q_INVOKABLE QVariantMap globalVariables ()
Q_INVOKABLE QVariantMap layerVariables (QgsMapLayer * layer)
QgsExpressionContextScope * mapToolCaptureScope (const SnappingResult & topSnappingResult)
QgsExpressionContextScope * positionScope (const GnssPositionInformation & positionInformation, bool positionLocked)
Q_INVOKABLE QVariantMap projectVariables (QgsProject * project)
Q_INVOKABLE void removeGlobalVariable (const QString & name)
Q_INVOKABLE void removeLayerVariable (QgsMapLayer * layer, const QString & name)
Q_INVOKABLE void removeProjectVariable (QgsProject * project, const QString & name)
Q_INVOKABLE void setGlobalVariable (const QString & name, const QVariant & value)
Q_INVOKABLE void setGlobalVariables (const QVariantMap & variables)
Q_INVOKABLE void setLayerVariable (QgsMapLayer * layer, const QString & name, const QVariant & value)
Q_INVOKABLE void setLayerVariables (QgsMapLayer * layer, const QVariantMap & variables)
Q_INVOKABLE void setProjectVariable (QgsProject * project, const QString & name, const QVariant & value)
Q_INVOKABLE void setProjectVariables (QgsProject * project, const QVariantMap & variables)

Public Functions Documentation

function ExpressionContextUtils

explicit ExpressionContextUtils::ExpressionContextUtils (
    QObject * parent=nullptr
) 

Public Static Functions Documentation

function cloudUserScope

static QgsExpressionContextScope * ExpressionContextUtils::cloudUserScope (
    const CloudUserInformation & cloudUserInformation
) 

function globalVariables

static Q_INVOKABLE QVariantMap ExpressionContextUtils::globalVariables () 

Returns the global context variables.

See also: setGlobalVariable()

See also: setGlobalVariables()

See also: removeGlobalVariable()


function layerVariables

static Q_INVOKABLE QVariantMap ExpressionContextUtils::layerVariables (
    QgsMapLayer * layer
) 

Returns a layer context variables.

Parameters:

  • layer map layer

See also: setLayerVariable()

See also: setLayerVariables()

See also: removeLayerVariable()


function mapToolCaptureScope

static QgsExpressionContextScope * ExpressionContextUtils::mapToolCaptureScope (
    const SnappingResult & topSnappingResult
) 

function positionScope

static QgsExpressionContextScope * ExpressionContextUtils::positionScope (
    const GnssPositionInformation & positionInformation,
    bool positionLocked
) 

function projectVariables

static Q_INVOKABLE QVariantMap ExpressionContextUtils::projectVariables (
    QgsProject * project
) 

Returns a project context variables.

Parameters:

  • project project

See also: setProjectVariable()

See also: setProjectVariables()

See also: removeProjectVariable()


function removeGlobalVariable

static Q_INVOKABLE void ExpressionContextUtils::removeGlobalVariable (
    const QString & name
) 

Removes a global context variable.

Parameters:

  • name variable name

See also: globalVariables()

See also: setGlobalVariable()

See also: setGlobalVariables()


function removeLayerVariable

static Q_INVOKABLE void ExpressionContextUtils::removeLayerVariable (
    QgsMapLayer * layer,
    const QString & name
) 

Removes a layer context variable.

Parameters:

  • layer map layer
  • name variable name

See also: layerVariables()

See also: setLayerVariable()

See also: setLayerVariables()


function removeProjectVariable

static Q_INVOKABLE void ExpressionContextUtils::removeProjectVariable (
    QgsProject * project,
    const QString & name
) 

Removes a project context variable.

Parameters:

  • project project
  • name variable name

See also: projectVariables()

See also: setProjectVariable()

See also: setProjectVariables()


function setGlobalVariable

static Q_INVOKABLE void ExpressionContextUtils::setGlobalVariable (
    const QString & name,
    const QVariant & value
) 

Sets a global context variable.

Parameters:

  • name variable name
  • value variable value

See also: globalVariables()

See also: setGlobalVariables()

See also: removeGlobalVariable()


function setGlobalVariables

static Q_INVOKABLE void ExpressionContextUtils::setGlobalVariables (
    const QVariantMap & variables
) 

Sets the global context variables.

Parameters:

  • variables new set of global variables

See also: globalVariables()

See also: setGlobalVariable()

See also: removeGlobalVariable()


function setLayerVariable

static Q_INVOKABLE void ExpressionContextUtils::setLayerVariable (
    QgsMapLayer * layer,
    const QString & name,
    const QVariant & value
) 

Sets a layer context variable.

Parameters:

  • layer map layer
  • name variable name
  • value variable value

See also: layerVariables()

See also: setLayerVariables()

See also: removeLayerVariable()


function setLayerVariables

static Q_INVOKABLE void ExpressionContextUtils::setLayerVariables (
    QgsMapLayer * layer,
    const QVariantMap & variables
) 

Sets a layer context variables.

Parameters:

  • layer map layer
  • variables new set of layer variables

See also: layerVariables()

See also: setLayerVariable()

See also: removeLayerVariable()


function setProjectVariable

static Q_INVOKABLE void ExpressionContextUtils::setProjectVariable (
    QgsProject * project,
    const QString & name,
    const QVariant & value
) 

Sets a project context variable.

Parameters:

  • project project
  • name variable name
  • value variable value

See also: projectVariables()

See also: setProjectVariables()

See also: removeProjectVariable()


function setProjectVariables

static Q_INVOKABLE void ExpressionContextUtils::setProjectVariables (
    QgsProject * project,
    const QVariantMap & variables
) 

Sets a project context variables.

Parameters:

  • project project
  • variables new set of project variables

See also: projectVariables()

See also: setProjectVariable()

See also: removeProjectVariable()



The documentation for this class was generated from the following file src/core/utils/expressioncontextutils.h