Skip To Content ArcGIS for Developers Sign In Dashboard

ImmutablePortalItemListModel Class


Represents an immutable list of portal items. More...

Header: #include <ImmutablePortalItemListModel>
Since: Esri::ArcGISRuntime 100.3
Inherits: QAbstractListModel and Iterable<PortalItem *>

Public Functions

PortalItem *at(int index) const
bool contains(PortalItem *portalItem) const
PortalItem *first() const
int indexOf(PortalItem *portalItem) const
bool isEmpty() const
PortalItem *last() const
int size() const

Reimplemented Public Functions

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


void errorOccurred(Esri::ArcGISRuntime::Error error)

Additional Inherited Members

Detailed Description

Represents an immutable list of portal items.

A PortalItem is a unit of content in the Portal.

The model returns data for the following roles:

urlQUrlThe URL for the resource represented by the item.PortalItemUrlRole
itemIdQStringThe ID of the item.PortalItemItemIdRole
accessPortalAccessThe level of access to the item.PortalItemAccessRole
accessAndUseConstraintsHtmlQStringThe access and use constraints HTML.PortalItemAccessAndUseConstraintsHtmlRole
averageRatingintThe average rating of the item.PortalItemAverageRatingRole
commentCountintThe number of comments for the item.PortalItemCommentCountRole
commentsEnabledboolWhether comments are allowed on the item.PortalItemCommentsEnabledRole
cultureQStringThe item locale information (language and country).PortalItemCultureRole
folderIdQStringThe ID of the folder containing the item.PortalItemFolderIdRole
nameQStringThe name of this item.PortalItemNameRole
ownerQStringThe username of the user who owns the item.PortalItemOwnerRole
ratingCountintThe number of ratings received by the item.PortalItemRatingCountRole
serviceUrlintThe service URL for the item.PortalItemServiceUrlRole
sizeqint64The size of the item in bytes.PortalItemSizeRole
typePortalItemTypeThe type of the item.PortalItemTypeRole
typeKeywordsQStringListA set of keywords that further describes the type of the item.PortalItemTypeKeywordsRole
typeNameQStringThe name of the type of this item.PortalItemTypeNameRole
viewCountintThe number of times this item has been viewed.PortalItemViewCountRole
descriptionQStringThe item description.PortalItemDescriptionRole
extentEnvelopeThe bounding rectangle of the item.PortalItemExtentRole
snippetQStringThe short summary description of the item.PortalItemSnippetRole
titleQStringThe title of the item.PortalItemTitleRole
accessInformationQStringThe access information on the source of the item.PortalItemAccessInformationRole
tagsQStringListThe user-defined tags that describe the item.PortalItemTagsRole
createdQDateTimeThe creation date of the item.PortalItemCreatedRole
modifiedQDateTimeThe date the item was last modified.PortalItemModifiedRole
spatialReferenceSpatialReferenceThe spatial reference of the item.PortalItemSpatialReferenceRole
thumbnailUrlQUrlThe thumbnail of the item as a local file URL.PortalItemThumbnailUrlRole

See also Portal, PortalUser, and PortalItem.

Member Function Documentation



PortalItem *ImmutablePortalItemListModel::at(int index) const

Returns the PortalItem at the specified index.

bool ImmutablePortalItemListModel::contains(PortalItem *portalItem) const

Returns whether the list model contains the specified portalItem.

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

Reimplemented from QAbstractItemModel::data().

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

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

[signal] void ImmutablePortalItemListModel::errorOccurred(Esri::ArcGISRuntime::Error error)

Signal emitted when an error occurs.

  • error - Details about the error.

PortalItem *ImmutablePortalItemListModel::first() const

Returns the first PortalItem in the list model.

int ImmutablePortalItemListModel::indexOf(PortalItem *portalItem) const

Returns the index of the PortalItem portalItem.

bool ImmutablePortalItemListModel::isEmpty() const

Returns whether the list model contains no items.

PortalItem *ImmutablePortalItemListModel::last() const

Returns the last PortalItem in the list model.

int ImmutablePortalItemListModel::size() const

Returns the number of items contained in the list model.

Feedback on this topic?