PopupAttachmentListModel Class

  • PopupAttachmentListModel
  • class Esri::ArcGISRuntime::PopupAttachmentListModel

    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

    This class was introduced in Esri::ArcGISRuntime 100.1.

    Public Types

    enum PopupAttachmentRoles { PopupAttachmentNameRole, PopupAttachmentContentTypeRole, PopupAttachmentSizeRole, PopupAttachmentLocalRole, PopupAttachmentAttachmentUrlRole, …, PopupAttachmentFullImageUrlRole }

    Properties

    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

    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:

    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

    [signal] 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.

    [signal] 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.

    [signal] 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.

    [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.

    [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.

    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.

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