ArcGIS Developers
Dashboard

ArcadeLabelExpression Class

class Esri::ArcGISRuntime::ArcadeLabelExpression

An expression script using the Arcade language. More...

Header: #include <ArcadeLabelExpression>
Since: Esri::ArcGISRuntime 100.11
Inherits: Esri::ArcGISRuntime::LabelExpression

This class was introduced in Esri::ArcGISRuntime 100.11.

Public Functions

ArcadeLabelExpression(const QString &arcadeString, QObject *parent = nullptr)
ArcadeLabelExpression(Esri::ArcGISRuntime::ArcadeExpression *arcadeExpression, QObject *parent = nullptr)
ArcadeLabelExpression(QObject *parent = nullptr)
virtual ~ArcadeLabelExpression() override
Esri::ArcGISRuntime::ArcadeExpression *arcadeExpression() const
void setArcadeExpression(Esri::ArcGISRuntime::ArcadeExpression *arcadeExpression)

Detailed Description

The label arcade expression expects to hold a legal, Arcade script and to be read and evaluated by an Arcade expression interpreter. An example expression that combines text with a field value is

"State: " + $feature.State_Name

Note that quotes are needed around the literal text. See https://developers.arcgis.com/arcade/ for full documentation on the Arcade scripting language and its function library.

Member Function Documentation

ArcadeLabelExpression::ArcadeLabelExpression(const QString &arcadeString, QObject *parent = nullptr)

Create a label arcade expression object with a specified Arcade expression script.

  • arcadeString - The Arcade expression script string.
  • parent - The optional parent QObject.

The expression is expected to be a complete, self-contained Arcade expression.

ArcadeLabelExpression::ArcadeLabelExpression(Esri::ArcGISRuntime::ArcadeExpression *arcadeExpression, QObject *parent = nullptr)

Create a label arcade expression object using the ArcadeExpression::expression.

  • arcadeExpression - An ArcadeExpression containing the Arcade expression script to use.
  • parent - The optional parent QObject.

ArcadeLabelExpression::ArcadeLabelExpression(QObject *parent = nullptr)

Create a label arcade expression with an empty expression script.

  • parent - The optional parent QObject.

An empty script is a legal Arcade expression that will evaluate to an empty string.

[override virtual] ArcadeLabelExpression::~ArcadeLabelExpression()

Destructor.

Esri::ArcGISRuntime::ArcadeExpression *ArcadeLabelExpression::arcadeExpression() const

Returns an ArcadeExpression containing the Arcade expression script to use.

The expression is expected to be a complete, self-contained Arcade script that calculates a text string.

The ArcadeExpression::expression property of arcadeExpression is the same script string as LabelExpression::expression. Changing one will change the other.

See also setArcadeExpression().

void ArcadeLabelExpression::setArcadeExpression(Esri::ArcGISRuntime::ArcadeExpression *arcadeExpression)

Sets the arcadeExpression to arcadeExpression.

See also arcadeExpression.


Feedback on this topic?