Represents a list of portal items. More...
Header | #include <Portal |
Since | Esri |
Inherits | Q |
Public Types
enum | Portal |
Public Functions
virtual | ~ |
bool | contains( |
Esri | first() const |
int | index |
bool | is |
Esri | last() const |
Reimplemented Public Functions
virtual Esri | at(int index) const override |
virtual Q | data(const Q |
virtual int | size() const override |
Signals
void | error |
(since Esri void | item |
(since Esri void | item |
Detailed Description
A PortalItem is a unit of content in the Portal. This type is populated by starting an operation to retrieve content and then can be accessed after the operation is complete. For example, the list of items can be retrieved by: querying the portal (such as with PortalQueryParametersForItems) or by fetching the featuredItems or by fetching the items belonging to a user.
The model returns data for the following roles:
Role | Type | Description | PortalItemRoles |
---|---|---|---|
url | Q | The UR | Portal |
item | Q | The I | Portal |
access | Portal | The level of access to the item. | Portal |
average | int | The average rating of the item. | Portal |
comment | int | The number of comments for the item. | Portal |
comments | bool | Whether comments are allowed on the item. | Portal |
culture | Q | The item locale information (language and country). | Portal |
folder | Q | The I | Portal |
name | Q | The name of this item. | Portal |
owner | Q | The username of the user who owns the item. | Portal |
rating | int | The number of ratings received by the item. | Portal |
service | int | The service UR | Portal |
size | qint64 | The size of the item in bytes. | Portal |
type | Portal | The type of the item. | Portal |
type | Q | A set of keywords that further describes the type of the item. | Portal |
type | Q | The name of the type of this item. | Portal |
view | int | The number of times this item has been viewed. | Portal |
description | Q | The item description. | Portal |
extent | Envelope | The bounding rectangle of the item. | Portal |
snippet | Q | The short summary description of the item. | Portal |
title | Q | The title of the item. | Portal |
access | Q | The access information on the source of the item. | Portal |
tags | Q | The user-defined tags that describe the item. | Portal |
created | Q | The creation date of the item. | Portal |
modified | Q | The date the item was last modified. | Portal |
spatial | Spatial | The spatial reference of the item. | Portal |
thumbnail | Q | The thumbnail of the item as a local file UR | Portal |
terms | Q | The terms of use of the item. | Portal |
Example: Accessing roles from a PortalItemListModel from within a QML delegate:
Text { anchors { fill: parent margins: 10 } text: title // access the title role of the model color: "white" elide: Text.ElideRight wrapMode: Text.Wrap horizontalAlignment: Text.AlignHCenter }
See also Portal, PortalUser, and PortalItem.
Member Type Documentation
enum PortalItemListModel::PortalItemRoles
This enum specifies the custom roles which can be used with PortalItemListModel::data and ImmutablePortalItemListModel::data.
Constant | Value | Description |
---|---|---|
Esri | Qt | The UR |
Esri | Qt | The I |
Esri | Qt | The level of access to the item. |
Esri | Qt | The average rating of the item. |
Esri | Qt | The number of comments for the item. |
Esri | Qt | Whether comments are allowed on the item. |
Esri | Qt | The item locale information (language and country). |
Esri | Qt | The I |
Esri | Qt | The name of this item. |
Esri | Qt | The username of the user who owns the item. |
Esri | Qt | The number of ratings received by the item. |
Esri | Qt | The service UR |
Esri | Qt | The size of the item in bytes. |
Esri | Qt | The type of the item. |
Esri | Qt | A set of keywords that further describes the type of the item. |
Esri | Qt | The name of the type of this item. |
Esri | Qt | The number of times this item has been viewed. |
Esri | Qt | The item description. |
Esri | Qt | The bounding rectangle of the item. |
Esri | Qt | The short summary description of the item. |
Esri | Qt | The title of the item. |
Esri | Qt | The access information on the source of the item. |
Esri | Qt | The user-defined tags that describe the item. |
Esri | Qt | The creation date of the item. |
Esri | Qt | The date the item was last modified. |
Esri | Qt | The spatial reference of the item. |
Esri | Qt | The thumbnail of the item as a local file UR |
Esri | Qt | The terms of use of the item. |
Member Function Documentation
[override virtual noexcept]
PortalItemListModel::~PortalItemListModel ()
Destructor.
[override virtual]
Esri::ArcGISRuntime::PortalItem *PortalItemListModel::at(int index) const
Returns the PortalItem at the specified index.
bool PortalItemListModel::contains(Esri::ArcGISRuntime::PortalItem *portalItem ) const
Returns whether the list model contains the specified portalItem.
[override virtual]
QVariant PortalItemListModel::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 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 PortalItemListModel::errorOccurred (const Esri::ArcGISRuntime::Error &error)
Signal emitted when an error occurs.
- error - Details about the error.
Esri::ArcGISRuntime::PortalItem *PortalItemListModel::first() const
Returns the first PortalItem in the list model.
int PortalItemListModel::indexOf (Esri::ArcGISRuntime::PortalItem *portalItem ) const
Returns the index of the PortalItem portalItem.
bool PortalItemListModel::isEmpty () const
Returns whether the list model contains no items.
[signal, since Esri::ArcGISRuntime 100.15]
void PortalItemListModel::itemAdded (int index)
Signal emitted when an item is added to the list model.
index is the index of the added item.
This function was introduced in Esri::ArcGISRuntime 100.15.
[signal, since Esri::ArcGISRuntime 100.15]
void PortalItemListModel::itemRemoved (int index)
Signal emitted when an item is removed from the list model.
index is the index of the removed item.
This function was introduced in Esri::ArcGISRuntime 100.15.
Esri::ArcGISRuntime::PortalItem *PortalItemListModel::last() const
Returns the last PortalItem in the list model.
[override virtual]
int PortalItemListModel::size() const
Returns the number of items contained in the list model.