A list model storing a list of PopupAttachment available for an ArcGISFeature. More...
Header: | #include <PopupAttachmentListModel.h> |
Since: | Esri::ArcGISRuntime 100.1 |
Inherits: | QAbstractListModel and Esri::ArcGISRuntime::Iterable |
Public Types
enum | PopupAttachmentRoles { PopupAttachmentNameRole, PopupAttachmentContentTypeRole, PopupAttachmentSizeRole, PopupAttachmentLocalRole, PopupAttachmentAttachmentUrlRole, …, PopupAttachmentFullImageUrlRole } |
Properties
- count : const int
- thumbnailHeight : const int
- thumbnailWidth : const int
Public Functions
virtual | ~PopupAttachmentListModel() override |
bool | applyFilter() 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) |
Esri::ArcGISRuntime::AspectRatioMode | thumbnailAspectRatioMode() const |
int | thumbnailHeight() const |
int | thumbnailWidth() const |
Reimplemented Public Functions
virtual Esri::ArcGISRuntime::PopupAttachment * | at(int index) const override |
virtual QVariant | data(const QModelIndex &index, int role = Qt::DisplayRole) const override |
virtual int | size() const override |
Signals
void | countChanged() |
void | thumbnailHeightChanged() |
void | thumbnailWidthChanged() |
Detailed Description
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:
Role | Type | Description | PopupAttachmentRoles |
---|---|---|---|
name | QString | The name of the attachment. | PopupAttachmentNameRole |
contentType | QString | The MIME type of the attachment file. | PopupAttachmentContentTypeRole |
size | int | The size of the attachment in bytes. | PopupAttachmentSizeRole |
local | bool | Whether the data for the attachments has been downloaded locally. | PopupAttachmentLocalRole |
attachmentUrl | QUrl | The URL of the attachment. | PopupAttachmentAttachmentUrlRole |
popupType | Esri::ArcGISRuntime::PopupAttachmentType | The type of popup attachment. | PopupAttachmentPopupTypeRole |
editState | Esri::ArcGISRuntime::PopupAttachmentEditState | The popup attachment edit state. | PopupAttachmentEditStateRole |
thumbnailUrl | QUrl | The URL to the thumbnail. | PopupAttachmentThumbnailUrlRole |
fullImageUrl | QUrl | The 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.
Constant | Value | Description |
---|---|---|
Esri::ArcGISRuntime::PopupAttachmentListModel::PopupAttachmentNameRole | Qt::DisplayRole | The name of the attachment. |
Esri::ArcGISRuntime::PopupAttachmentListModel::PopupAttachmentContentTypeRole | Qt::UserRole + 1 | The MIME type of the attachment file. |
Esri::ArcGISRuntime::PopupAttachmentListModel::PopupAttachmentSizeRole | Qt::UserRole + 2 | The size of the attachment in bytes. |
Esri::ArcGISRuntime::PopupAttachmentListModel::PopupAttachmentLocalRole | Qt::UserRole + 3 | Whether the data for the attachments has been downloaded locally. |
Esri::ArcGISRuntime::PopupAttachmentListModel::PopupAttachmentAttachmentUrlRole | Qt::UserRole + 4 | The URL of the attachment. |
Esri::ArcGISRuntime::PopupAttachmentListModel::PopupAttachmentPopupTypeRole | Qt::UserRole + 5 | The type of popup attachment. |
Esri::ArcGISRuntime::PopupAttachmentListModel::PopupAttachmentEditStateRole | Qt::UserRole + 6 | The popup attachment edit state. |
Esri::ArcGISRuntime::PopupAttachmentListModel::PopupAttachmentThumbnailUrlRole | Qt::UserRole + 7 | The URL to the thumbnail. |
Esri::ArcGISRuntime::PopupAttachmentListModel::PopupAttachmentFullImageUrlRole | Qt::UserRole + 8 | The URL to the full image. |
Property Documentation
[read-only]
count : const int
This property holds the number of attachments in the list model (read-only).
Notifier signal:
void | countChanged() |
[read-only]
thumbnailHeight : const int
This property holds the attachment's thumbnail height (read-only).
Access functions:
int | thumbnailHeight() const |
Notifier signal:
void | thumbnailHeightChanged() |
[read-only]
thumbnailWidth : const int
This property holds the attachment's thumbnail width (read-only).
Access functions:
int | thumbnailWidth() const |
Notifier signal:
void | thumbnailWidthChanged() |
Member Function Documentation
[override virtual]
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.
[override virtual]
Esri::ArcGISRuntime::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, since Esri::ArcGISRuntime 100.4]
void PopupAttachmentListModel::countChanged ()
Signal emitted when the model row count changes.
Note: Notifier signal for property count.
This function was introduced in Esri::ArcGISRuntime 100.4.
[override virtual]
QVariant PopupAttachmentListModel::data(const QModelIndex &index, int role = Qt::DisplayRole) const
Reimplements: QAbstractItemModel::data(const QModelIndex &index, int role) const.
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.
[override virtual]
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, since Esri::ArcGISRuntime 100.1]
void PopupAttachmentListModel::thumbnailHeightChanged ()
Signal emitted when the thumbnail height changes.
Note: Notifier signal for property thumbnailHeight.
This function was introduced in Esri::ArcGISRuntime 100.1.
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, since Esri::ArcGISRuntime 100.1]
void PopupAttachmentListModel::thumbnailWidthChanged ()
Signal emitted when the thumbnail width changes.
Note: Notifier signal for property thumbnailWidth.
This function was introduced in Esri::ArcGISRuntime 100.1.