Skip To Content ArcGIS for Developers Sign In Dashboard

PopupAttachmentListModel Class

(Esri::ArcGISRuntime::PopupAttachmentListModel)

A list model storing a list of PopupAttachment available for an ArcGISFeature. More...

Header: #include <PopupAttachmentListModel>
Since: Esri::ArcGISRuntime 100.1
Inherits: QAbstractListModel and Iterable<PopupAttachment *>

Public Types

enum PopupAttachmentRoles { PopupAttachmentNameRole, PopupAttachmentContentTypeRole, PopupAttachmentSizeRole, PopupAttachmentLocalRole, ..., PopupAttachmentFullImageUrlRole }

Properties

  • 1 property inherited from QObject

Public Functions

~PopupAttachmentListModel()
bool applyFilter() const
PopupAttachment *at(int index) const
bool autoFetchFullImages() const
bool autoFetchThumbnails() const
bool autoLoad() const
void setApplyFilter(bool applyFilter)
void setAutoFetchFullImages(bool autoFetchFullImages)
void setAutoFetchThumbnails(bool autoFetchThumbnails)
void setAutoLoad(bool autoLoad)
void setThumbnailAspectRatioMode(Esri::ArcGISRuntime::AspectRatioMode thumbnailAspectRatioMode)
void setThumbnailHeight(int thumbnailHeight)
void setThumbnailWidth(int thumbnailWidth)
int size() const
Esri::ArcGISRuntime::AspectRatioMode thumbnailAspectRatioMode() const
int thumbnailHeight() const
int thumbnailWidth() const

Reimplemented Public Functions

virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const

Signals

Additional Inherited Members

Detailed Description

A list model storing a list of PopupAttachment available for an ArcGISFeature.

Obtain a PopupAttachmentListModel from a PopupAttachmentManager.

The model will automatically fetch attachments from the underlying features so that they can be displayed in a view.

This class is a subclass of QAbstractListModel.

The model returns data for the following roles:

RoleTypeDescriptionPopupAttachmentRoles
nameQStringThe name of the attachment.PopupAttachmentNameRole
contentTypeQStringThe MIME type of the attachment file.PopupAttachmentContentTypeRole
sizeintThe size of the attachment in bytes.PopupAttachmentSizeRole
localboolWhether the data for the attachments has been downloaded locally.PopupAttachmentLocalRole
attachmentUrlQUrlThe URL of the attachment.PopupAttachmentAttachmentUrlRole
popupTypeEsri::ArcGISRuntime::PopupAttachmentTypeThe type of popup attachment.PopupAttachmentPopupTypeRole
editStateEsri::ArcGISRuntime::PopupAttachmentEditStateThe popup attachment edit state.PopupAttachmentEditStateRole
thumbnailUrlQUrlThe URL to the thumbnail.PopupAttachmentThumbnailUrlRole
fullImageUrlQUrlThe URL to the full image.PopupAttachmentFullImageUrlRole

Member Type Documentation

enum PopupAttachmentListModel::PopupAttachmentRoles

This enum specifies the custom roles which can be used with PopupAttachmentListModel::data.

ConstantValueDescription
Esri::ArcGISRuntime::PopupAttachmentListModel::PopupAttachmentNameRoleQt::DisplayRoleThe name of the attachment.
Esri::ArcGISRuntime::PopupAttachmentListModel::PopupAttachmentContentTypeRoleQt::UserRole + 1The MIME type of the attachment file.
Esri::ArcGISRuntime::PopupAttachmentListModel::PopupAttachmentSizeRoleQt::UserRole + 2The size of the attachment in bytes.
Esri::ArcGISRuntime::PopupAttachmentListModel::PopupAttachmentLocalRoleQt::UserRole + 3Whether the data for the attachments has been downloaded locally.
Esri::ArcGISRuntime::PopupAttachmentListModel::PopupAttachmentAttachmentUrlRoleQt::UserRole + 4The URL of the attachment.
Esri::ArcGISRuntime::PopupAttachmentListModel::PopupAttachmentPopupTypeRoleQt::UserRole + 5The type of popup attachment.
Esri::ArcGISRuntime::PopupAttachmentListModel::PopupAttachmentEditStateRoleQt::UserRole + 6The popup attachment edit state.
Esri::ArcGISRuntime::PopupAttachmentListModel::PopupAttachmentThumbnailUrlRoleQt::UserRole + 7The URL to the thumbnail.
Esri::ArcGISRuntime::PopupAttachmentListModel::PopupAttachmentFullImageUrlRoleQt::UserRole + 8The URL to the full image.

Property Documentation

count : const int

This property holds the number of attachments in the list model (read-only).

Notifier signal:

void countChanged()

thumbnailHeight : const int

This property holds the attachment's thumbnail height (read-only).

Access functions:

int thumbnailHeight() const

Notifier signal:

thumbnailWidth : const int

This property holds the attachment's thumbnail width (read-only).

Access functions:

int thumbnailWidth() const

Notifier signal:

Member Function Documentation

PopupAttachmentListModel::~PopupAttachmentListModel()

Destructor.

bool PopupAttachmentListModel::applyFilter() const

Returns whether the model is displaying PopupAttachmentManager::attachments (false) or PopupAttachmentManager::filterAttachments (true).

Note: The default value is false.

See also setApplyFilter(), PopupAttachmentManager::filterAttachments, and PopupAttachmentManager::attachments.

PopupAttachment *PopupAttachmentListModel::at(int index) const

Returns the popup attachment at the specified index.

bool PopupAttachmentListModel::autoFetchFullImages() const

Returns whether the model should automatically request full images for attachments as they are accessed.

The popup attachment will be loaded when full images are requested if it is not loaded.

Note: The default value is true.

See also setAutoFetchFullImages().

bool PopupAttachmentListModel::autoFetchThumbnails() const

Returns whether the model should automatically request thumbnail images for attachments as they are accessed.

The popup attachment will be loaded when thumbnails are requested if it is not loaded.

Note: The default value is true.

See also setAutoFetchThumbnails().

bool PopupAttachmentListModel::autoLoad() const

Returns whether the model should attempt to load each popup attachment as they are accessed by the model.

Note: The default value is true.

See also setAutoLoad() and Loadable.

[signal] void PopupAttachmentListModel::countChanged()

Signal emitted when the model row count changes.

This function was introduced in Esri::ArcGISRuntime 100.4.

Note: Notifier signal for property count.

[virtual] QVariant PopupAttachmentListModel::data(const QModelIndex &index, int role = Qt::DisplayRole) const

Reimplemented from QAbstractItemModel::data().

Returns the data stored under the given role for the popup referred to by the index.

  • index. The index in the model for which to return data.
  • role. The role for which to return data.

void PopupAttachmentListModel::setApplyFilter(bool applyFilter)

Sets whether the model should display PopupAttachmentManager::attachments or PopupAttachmentManager::filterAttachments to applyFilter. This can be changed at any time.

Note: Setting this to true will return the filtered attachments. The default value is false.

See also applyFilter(), PopupAttachmentManager::filterAttachments, and PopupAttachmentManager::attachments.

void PopupAttachmentListModel::setAutoFetchFullImages(bool autoFetchFullImages)

Sets whether the model should automatically request full images for attachments as they are accessed to autoFetchFullImages.

If this is true the model will request full images if it encounters an empty full image from the underlying popup attachment.

See also autoFetchFullImages().

void PopupAttachmentListModel::setAutoFetchThumbnails(bool autoFetchThumbnails)

Sets whether the model should automatically request thumbnail images for attachments as they are accessed to autoFetchThumbnails.

If this is true the model will request thumbnail images if it encounters an empty thumbnail from the underlying popup attachment.

See also autoFetchThumbnails(), thumbnailWidth, thumbnailHeight, and thumbnailAspectRatioMode.

void PopupAttachmentListModel::setAutoLoad(bool autoLoad)

Sets whether the model should attempt to load each popup attachment as they are accessed by the model to autoLoad.

See also autoLoad() and Loadable.

void PopupAttachmentListModel::setThumbnailAspectRatioMode(Esri::ArcGISRuntime::AspectRatioMode thumbnailAspectRatioMode)

Sets the aspect ratio mode of each thumbnail requested by the model to thumbnailAspectRatioMode.

See also thumbnailAspectRatioMode() and autoFetchThumbnails.

void PopupAttachmentListModel::setThumbnailHeight(int thumbnailHeight)

Sets the height of each thumbnail requested by the model to thumbnailHeight.

See also thumbnailHeight() and autoFetchThumbnails.

void PopupAttachmentListModel::setThumbnailWidth(int thumbnailWidth)

Sets the width of each thumbnail requested by the model to thumbnailWidth.

See also thumbnailWidth() and autoFetchThumbnails.

int PopupAttachmentListModel::size() const

Returns the number of popup attachments in the model.

Esri::ArcGISRuntime::AspectRatioMode PopupAttachmentListModel::thumbnailAspectRatioMode() const

Returns the aspect ratio mode of each thumbnail requested by the model.

Note: The default value is Esri::ArcGISRuntime::AspectRatioMode::KeepAspectRatio.

See also setThumbnailAspectRatioMode() and autoFetchThumbnails.

int PopupAttachmentListModel::thumbnailHeight() const

Returns the height of each thumbnail requested by the model.

Note: The default value is 64.

Note: Getter function for property thumbnailHeight.

See also setThumbnailHeight() and autoFetchThumbnails.

[signal] void PopupAttachmentListModel::thumbnailHeightChanged()

Signal emitted when the thumbnail height changes.

This function was introduced in Esri::ArcGISRuntime 100.1.

Note: Notifier signal for property thumbnailHeight.

int PopupAttachmentListModel::thumbnailWidth() const

Returns the width of each thumbnail requested by the model.

Note: The default value is 64.

Note: Getter function for property thumbnailWidth.

See also setThumbnailWidth() and autoFetchThumbnails.

[signal] void PopupAttachmentListModel::thumbnailWidthChanged()

Signal emitted when the thumbnail width changes.

This function was introduced in Esri::ArcGISRuntime 100.1.

Note: Notifier signal for property thumbnailWidth.


Feedback on this topic?