Skip To Content ArcGIS for Developers Sign In Dashboard

PopupManager Class

(Esri::ArcGISRuntime::PopupManager)

Manages the viewing and editing of a Popup. More...

Header: #include <PopupManager>
Since: Esri::ArcGISRuntime 100.0
Inherits: Object

Properties

  • 1 property inherited from QObject

Public Functions

PopupManager(Popup *popup, QObject *parent = nullptr)
~PopupManager()
PopupAttachmentManager *attachmentManager() const
void cancelEditing()
QString customHtmlDescription() const
PopupAttributeListModel *displayedFields() const
bool doesChangeRequireNotification(const FeatureTemplate &featureTemplate) const
Domain domain(PopupField *popupField) const
QString editSummary() const
PopupAttributeListModel *editableFields() const
GeometryBuilder *editingGeometryBuilder() const
QList<FeatureType> featureTypes() const
PopupField *fieldByName(const QString &fieldName) const
QString fieldLabel(PopupField *popupField) const
FieldType fieldType(PopupField *popupField) const
QVariant fieldValue(PopupField *popupField) const
void finishEditing()
QString formattedValue(PopupField *popupField) const
bool isDeleteAllowed() const
bool isEditGeometryAllowed() const
bool isEditing() const
bool isEditingAllowed() const
bool isFeatureType(PopupField *popupField) const
bool isGeoElementValid() const
bool isNullable(PopupField *popupField) const
bool isShowAttachments() const
bool isShowCustomHtmlDescription() const
bool isShowEditSummary() const
bool isShowMedia() const
int maxLength(PopupField *popupField) const
Popup *popup() const
QString rangeDomainValidationText(PopupField *popupField) const
void setEditingGeometryBuilder(GeometryBuilder *builder)
bool startEditing()
QString substitute(const QString &templateString) const
Symbol *symbol() const
QString title() const
Error updateValue(const QVariant &newValue, PopupField *popupField)
Error updateValue(const FeatureTemplate &featureTemplate, FeatureTypeChangeMode changeMode)
Error validationError(PopupField *popupField) const
  • 31 public functions inherited from QObject

Signals

void editingCompleted(Esri::ArcGISRuntime::Error error)
void featureTypeChanged()
void geoElementValidChanged()
void geometryBuilderRequired()

Additional Inherited Members

  • 1 public slot inherited from QObject
  • 1 public variable inherited from QObject
  • 10 static public members inherited from QObject
  • 9 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

Manages the viewing and editing of a Popup.

This class works in conjunction with the PopupView in the ArcGIS Runtime Toolkit. The PopupView is used to display information about a GeoElement. For example, a PopupView could be used to display the attributes of an ArcGISFeature that is stored in a Feature Service. PopupManager provides the PopupView with the content to display in the view. It also contains many helper functions and properties to assist the PopupView with displaying and editing information related to the associated GeoElement.

An example workflow for displaying a PopupView using a PopupManager would be:

  • Declare a PopupView and anchor it to a desired location.
  • Perform an identify operation on a GeoView and select a Feature from the identify result.
  • Create a Popup from the Feature.
  • Optionally obtain the Popup's PopupDefinition and set the title, whether to show attachments, and so on.
  • Create a PopupManager from the Popup.
  • Assign the PopupView's popupManager property the PopupManager created in the previous step.
  • Call the show() method to display the PopupView.
  • Call the dismiss() method to hide the PopupView.

Note: Each time a change is made to the Popup, PopupDefinition, PopupManager, or any of their properties, the PopupManager must be re-set to the PopupView.

In order to use the PopupManager with a QML UI, the PopupManager, PopupAttachmentManager, PopupAttachmentListModel, and PopupAttributeListModel classes must be registered as QML Types. For example, the following lines could be added to the main.cpp to register the classes under the Esri.Samples namespace:

qmlRegisterUncreatableType<PopupManager>("Esri.Samples", 1, 0, "PopupManager", "PopupManager is uncreateable");
qmlRegisterUncreatableType<PopupAttachmentManager>("Esri.Samples", 1, 0, "PopupAttachmentManager", "PopupAttachmentManager is uncreateable");
qmlRegisterUncreatableType<PopupAttributeListModel>("Esri.Samples", 1, 0, "PopupAttributeListModel", "PopupAttributeListModel is uncreateable");
qmlRegisterUncreatableType<PopupAttachmentListModel>("Esri.Samples", 1, 0, "PopupAttachmentListModel", "PopupAttachmentListModel is uncreateable");

Note: The default PopupView provided with the toolkit is built with Qt Quick for a QML UI. If using Qt Widgets, a custom Widgets UI could be created to consume the information provided by PopupManager.

Property Documentation

attachmentManager : PopupAttachmentManager * const

This property holds the Popup's PopupAttachmentManager (read-only).

Access functions:

PopupAttachmentManager *attachmentManager() const

customHtmlDescription : const QString

This property holds the Popup's custom HTML description (read-only).

Access functions:

QString customHtmlDescription() const

deleteAllowed : const bool

This property holds whether features can be deleted (read-only).

Access functions:

bool isDeleteAllowed() const

displayedFields : PopupAttributeListModel * const

This property holds the Popup's display fields as a PopupAttributeListModel (read-only).

Access functions:

PopupAttributeListModel *displayedFields() const

editGeometryAllowed : const bool

This property holds whether editing a feature's geometry is allowed (read-only).

Access functions:

bool isEditGeometryAllowed() const

editSummary : const QString

This property holds the Popup's edit summary (read-only).

Access functions:

QString editSummary() const

editableFields : PopupAttributeListModel * const

This property holds the Popup's editable fields as a PopupAttributeListModel (read-only).

Access functions:

PopupAttributeListModel *editableFields() const

editing : const bool

This property holds whether the PopupManager is in editing mode (read-only).

Access functions:

bool isEditing() const

editingAllowed : const bool

This property holds whether editing a feature is allowed (read-only).

Access functions:

bool isEditingAllowed() const

geoElementValid : const bool

This property holds whether the Popup's GeoElement is valid (read-only).

Access functions:

bool isGeoElementValid() const

showAttachments : const bool

This property holds whether attachments should be shown in the PopupView (read-only).

Access functions:

bool isShowAttachments() const

showCustomHtmlDescription : const bool

This property holds whether a custom HTML description should be shown in the PopupView (read-only).

Access functions:

showEditSummary : const bool

This property holds whether the edit summary should be shown in the PopupView (read-only).

Access functions:

bool isShowEditSummary() const

showMedia : const bool

This property holds whether media should be shown in the PopupView (read-only).

Access functions:

bool isShowMedia() const

title : const QString

This property holds the Popup's title (read-only).

Access functions:

QString title() const

Member Function Documentation

PopupManager::PopupManager(Popup *popup, QObject *parent = nullptr)

Constructor that takes a popup with an optional parent.

PopupManager::~PopupManager()

Destructor.

PopupAttachmentManager *PopupManager::attachmentManager() const

Returns the PopupAttachmentManager for this PopupManager.

Returns null if there is no associated PopupAttachmentManager.

This function was introduced in Esri::ArcGISRuntime 100.1.

Note: Getter function for property attachmentManager.

void PopupManager::cancelEditing()

Cancels the editing session.

Any edits that have been made since starting will be discarded.

QString PopupManager::customHtmlDescription() const

Returns the Popup's custom HTML description.

Note: Getter function for property customHtmlDescription.

PopupAttributeListModel *PopupManager::displayedFields() const

Returns the fields for display use as a PopupAttributeListModel.

Note: Getter function for property displayedFields.

bool PopupManager::doesChangeRequireNotification(const FeatureTemplate &featureTemplate) const

Returns whether changes to the specified featureTemplate requires a notification to the user that some data may be overwritten by the change.

Domain PopupManager::domain(PopupField *popupField) const

Returns the Domain of the specified popupField.

QString PopupManager::editSummary() const

Returns the current edit summary.

Note: Getter function for property editSummary.

PopupAttributeListModel *PopupManager::editableFields() const

Returns the editable fields as a PopupAttributeListModel.

Note: Getter function for property editableFields.

[signal] void PopupManager::editingCompleted(Esri::ArcGISRuntime::Error error)

Signal emitted when editing completes after finishEditing is called.

  • error - The Error object.

GeometryBuilder *PopupManager::editingGeometryBuilder() const

Returns the GeometryBuilder used to edit the GeoElement's geometry.

See also setEditingGeometryBuilder().

[signal] void PopupManager::featureTypeChanged()

Signal emitted when isFeatureType changes.

QList<FeatureType> PopupManager::featureTypes() const

Returns a list of FeatureTypes or null if the GeoElement is not an ArcGISFeature in an ArcGISFeatureTable.

PopupField *PopupManager::fieldByName(const QString &fieldName) const

Returns the PopupField object corresponding to the specified fieldName.

This will return null if there is no such field or if the GeoElement is not an ArcGISFeature with fields.

QString PopupManager::fieldLabel(PopupField *popupField) const

Returns the label of the specified popupField.

If the field is based on a PopupExpression, the title of the expression will be returned.

This function was introduced in Esri::ArcGISRuntime 100.3.

FieldType PopupManager::fieldType(PopupField *popupField) const

Returns the FieldType of the specified popupField.

QVariant PopupManager::fieldValue(PopupField *popupField) const

Returns the value of the specified popupField.

void PopupManager::finishEditing()

Finishes the editing session.

This runs asynchronously, and editingCompleted signal emit once the editing session has ended.

Note: The PopupManager does not automatically call applyEdits on the associated GeoElement's ArcGISFeatureTable. To commit any edits to the source data, call applyEdits on the associated ArcGISFeatureTable.

QString PopupManager::formattedValue(PopupField *popupField) const

Returns a formatted string representation of the specified popupField.

[signal] void PopupManager::geoElementValidChanged()

Signal emitted when isGeoElementValid changes.

[signal] void PopupManager::geometryBuilderRequired()

Signal emitted when a geometry builder is required.

bool PopupManager::isDeleteAllowed() const

Returns whether deleting the GeoElement is allowed.

Note: Getter function for property deleteAllowed.

bool PopupManager::isEditGeometryAllowed() const

Returns whether geometry editing is allowed.

Note: Getter function for property editGeometryAllowed.

bool PopupManager::isEditing() const

Returns whether the PopupManager is currently in editing mode.

Note: Getter function for property editing.

bool PopupManager::isEditingAllowed() const

Returns whether attribute editing is allowed.

Note: Getter function for property editingAllowed.

bool PopupManager::isFeatureType(PopupField *popupField) const

Returns whether the specified popupField is a FeatureType field.

bool PopupManager::isGeoElementValid() const

Returns whether the GeoElement is valid.

Note: Getter function for property geoElementValid.

bool PopupManager::isNullable(PopupField *popupField) const

Returns whether the specified popupField is nullable.

bool PopupManager::isShowAttachments() const

Returns whether attachments should be shown.

Note: Getter function for property showAttachments.

bool PopupManager::isShowCustomHtmlDescription() const

Returns whether the showCustomHtmlDescription should be shown.

Note: Getter function for property showCustomHtmlDescription.

bool PopupManager::isShowEditSummary() const

Returns whether the showEditSummary should be shown.

Note: Getter function for property showEditSummary.

bool PopupManager::isShowMedia() const

Returns whether media should be shown.

Note: Getter function for property showMedia.

int PopupManager::maxLength(PopupField *popupField) const

Returns the maximum allowed length of the specified popupField.

Returns the Popup that is being managed.

QString PopupManager::rangeDomainValidationText(PopupField *popupField) const

Returns a string that can be used to hint the acceptable values for a RangeDomain in a popupField.

void PopupManager::setEditingGeometryBuilder(GeometryBuilder *builder)

Sets the GeometryBuilder used to edit the GeoElement's geometry.

See also editingGeometryBuilder().

bool PopupManager::startEditing()

Initiates an editing session with the Popup.

Returns true if editing was started successfully and false if editing is already started or not allowed.

QString PopupManager::substitute(const QString &templateString) const

Substitutes attribute values for attribute place-holders in a given templateString.

Symbol *PopupManager::symbol() const

Returns the Symbol of the Popup.

QString PopupManager::title() const

Returns the Popup's title text.

Note: Getter function for property title.

Error PopupManager::updateValue(const QVariant &newValue, PopupField *popupField)

Updates the value of the specified popupField to the specified newValue.

Error PopupManager::updateValue(const FeatureTemplate &featureTemplate, FeatureTypeChangeMode changeMode)

Updates the GeoElement's featureTemplate, which in turn updates the values of its attribute table to match those in the feature template, dependent on the changeMode.

Error PopupManager::validationError(PopupField *popupField) const

Returns the validation Error for the specified popupField.


Feedback on this topic?