Popup Class

PopupDefinition and a GeoElement, which allows a visual representation of the GeoElement's attributes as well as the ability to edit them."> Popup Class | ArcGISQtCpp
  • Popup
  • class Esri::ArcGISRuntime::Popup

    The combination of a PopupDefinition and a GeoElement, which allows a visual representation of the GeoElement's attributes as well as the ability to edit them. More...

    Header: #include <Popup.h>
    Since: Esri::ArcGISRuntime 100.0
    Inherits: Esri::ArcGISRuntime::Object

    Public Functions

    Popup(Esri::ArcGISRuntime::GeoElement *geoElement, QObject *parent = nullptr)
    Popup(Esri::ArcGISRuntime::GeoElement *geoElement, Esri::ArcGISRuntime::PopupDefinition *popupDefinition, QObject *parent = nullptr)
    virtual ~Popup() override
    QFuture<QList<Esri::ArcGISRuntime::PopupExpressionEvaluation *>> evaluateExpressionsAsync(QObject *parent = nullptr)
    QList<Esri::ArcGISRuntime::PopupElement *> evaluatedElements() const
    QString formattedValue(Esri::ArcGISRuntime::PopupField *popupField) const
    Esri::ArcGISRuntime::GeoElement *geoElement() const
    Esri::ArcGISRuntime::PopupDefinition *popupDefinition() const
    Esri::ArcGISRuntime::Symbol *symbol() const
    QString title() const

    Detailed Description

    Use the Popup to create a PopupManager. The PopupManager can then be used in conjunction with the PopupView (from the ArcGIS Maps SDK Toolkit) for a visual representation of the Popup.

    Member Function Documentation

    Creates a new popup from a GeoElement.

    This method creates a default PopupDefinition with default properties and default popup elements based on the given GeoElement.

    Constructor that takes a geoElement and a popupDefinition with an optional parent.

    If you pass in a null PopupDefinition, a default one will be created for you based on the GeoElement's attributes and schema.

    [override virtual] Popup::~Popup()

    Destructor.

    [since Esri::ArcGISRuntime 200.2] QFuture<QList<Esri::ArcGISRuntime::PopupExpressionEvaluation *>> Popup::evaluateExpressionsAsync(QObject *parent = nullptr)

    Asynchronously evaluates all expressions available at PopupDefinition::expressions or at ExpressionPopupElement::popupExpression. The expression can include Arcade FeatureSet functions, which need to be evaluated asynchronously.

    • parent - The optional parent QObject

    Also populates the evaluatedElements from the PopupDefinition::elements. During the evaluation, each ExpressionPopupElement is replaced by the PopupElement returned by the Arcade expression and each placeholder is replaced by its value.

    This method must be called before displaying the popup information in a UI so you can use synchronous methods Esri::ArcGISRuntime::Popup::formattedValue() and Esri::ArcGISRuntime::PopupManager::substitute() to get the formatted QString representation. If there are no PopupDefinition::expressions and no popup elements of type ExpressionPopupElement then the result array will be empty.

    The PopupExpression may be used in the PopupDefinition::fields, PopupDefinition::media, PopupDefinition::title and PopupDefinition::description.

    This method returns a QFuture for the asynchronous operation. Use future.then() to continue processing when the operation completes. Use future.onFailed() to handle exceptions of type ErrorException.

    See Working with QFuture for further details.

    This function was introduced in Esri::ArcGISRuntime 200.2.

    [since Esri::ArcGISRuntime 100.14] QList<Esri::ArcGISRuntime::PopupElement *> Popup::evaluatedElements() const

    Returns a QList of PopupElement objects evaluated asynchronously by evaluateExpressionsAsync. During the evaluation, each ExpressionPopupElement is replaced by the PopupElement returned by the Arcade expression and each placeholder is replaced by its value. If the Arcade expression returns a list of attributes to be used by the pop-up element, these attributes will be used by formattedValue(PopupField).

    The list is empty while evaluateExpressionsAsync has not been executed, and is cleared if evaluateExpressionsAsync is executed more than once. After evaluation, the order of the pop-up elements in the QList matches the order elements present in PopupDefinition::elements and shown in the pop-up window. If an ExpressionPopupElement fails to be evaluated, then it will be skipped in the QList. Use the list of PopupExpressionEvaluation returned from evaluateExpressionsAsync to learn the cause of the error.

    This function was introduced in Esri::ArcGISRuntime 100.14.

    See also PopupDefinition::elements and evaluateExpressionsAsync.

    QString Popup::formattedValue(Esri::ArcGISRuntime::PopupField *popupField) const

    Returns the formatted value of the popup field.

    If PopupDefinition::expressions is not empty then the popupField may be using expressions with Arcade FeatureSet functions. Use Popup::evaluateExpressions() to evaluate the Arcade expressions before trying to get the formatted string representation of the popup field's value, otherwise it may return an empty string.

    Esri::ArcGISRuntime::GeoElement *Popup::geoElement() const

    Returns the GeoElement of this Popup.

    Esri::ArcGISRuntime::PopupDefinition *Popup::popupDefinition() const

    Returns the PopupDefinition of this Popup.

    Esri::ArcGISRuntime::Symbol *Popup::symbol() const

    Returns the Symbol of this Popup.

    QString Popup::title() const

    Returns the title of this Popup.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.