Represents a particular set of groups in a portal. 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
This model type is returned by:
- Querying a Portal using PortalQueryParametersForGroups.
- Accessing the featuredGroups of a Portal.
- Calling fetchGroups with a PortalItem.
The model returns data for the following roles:
Role | Type | Description | PortalGroupRoles |
---|---|---|---|
access | Portal | The access level for the group. | Portal |
admins | Q | The administrator users of the group. | Portal |
created | Q | The date the group was created. | Portal |
group | Q | The description of the group. | Portal |
group | Q | The group's I | Portal |
invitation | bool | Whether the group membership is invitation-only. | Portal |
modified | Q | The date on which the group was last modified. | Portal |
owner | Q | The username of the owner of the group. | Portal |
phone | Q | The telephone number of the group. | Portal |
snippet | Q | The group summary. | Portal |
sort | Portal | The field that items in the group are sorted by. | Portal |
sort | Portal | The sort order for items in this group. | Portal |
tags | Q | The user-defined tags that describe the group. | Portal |
thumbnail | Q | The UR | Portal |
title | Q | The title of the group. | Portal |
users | Q | The users of the group. | Portal |
view | bool | Whether the group membership is view-only. | Portal |
Example:
Access the various groups of a portalItem:
int adminGroupsCount = 0; int memberGroupsCount = 0; int otherGroupsCount = 0; auto fetchGroupsFuture = portalItem->fetchGroupsAsync().then([portalItem, &adminGroupsCount, &memberGroupsCount, &otherGroupsCount]() { // lambda function to iterate over PortalGroupListModels auto printGroupTitles = [](PortalGroupListModel* groupsModel, const QString& groupName) { if (!groupsModel) { return; } qDebug() << groupName << ":"; for (int i = 0; i < groupsModel->rowCount(); ++i) { if (groupsModel->at(i)) { qDebug() << groupsModel->at(i)->title(); } } }; printGroupTitles(portalItem->adminGroups(), "admin groups"); printGroupTitles(portalItem->memberGroups(), "member groups"); printGroupTitles(portalItem->otherGroups(), "other groups"); adminGroupsCount = portalItem->adminGroups()->rowCount(); memberGroupsCount = portalItem->memberGroups()->rowCount(); otherGroupsCount = portalItem->otherGroups()->rowCount(); });
Example:
Accessing various roles of the model from within a QML delegate:
Image { source: thumbnailUrl // use the thumbnailUrl role of the model fillMode: Image.PreserveAspectCrop height: parent.height width: height } Text { text: title // access the title role of the group font.bold: true }
See also Portal, PortalGroup, PortalItem, PortalQueryParametersForGroups, and PortalQueryResultSetForGroups.
Member Type Documentation
enum PortalGroupListModel::PortalGroupRoles
This enum specifies the custom roles which can be used with PortalGroupListModel::data.
Constant | Value | Description |
---|---|---|
Esri | Qt | The access level for the group. |
Esri | Qt | The administrator users of the group. |
Esri | Qt | The date the group was created. |
Esri | Qt | The description of the group. |
Esri | Qt | The group's I |
Esri | Qt | Whether the group membership is invitation-only. |
Esri | Qt | The date on which the group was last modified. |
Esri | Qt | The username of the owner of the group. |
Esri | Qt | The telephone number of the group. |
Esri | Qt | The group summary. |
Esri | Qt | The field that items in the group are sorted by. |
Esri | Qt | The sort order for items in this group. |
Esri | Qt | The user-defined tags that describe the group. |
Esri | Qt | The UR |
Esri | Qt | The title of the group. |
Esri | Qt | The users of the group. |
Esri | Qt | Whether the group membership is view-only. |
Member Function Documentation
[override virtual noexcept]
PortalGroupListModel::~PortalGroupListModel ()
Destructor.
[override virtual]
Esri::ArcGISRuntime::PortalGroup *PortalGroupListModel::at(int index) const
Returns the PortalGroup at the specified index.
bool PortalGroupListModel::contains(Esri::ArcGISRuntime::PortalGroup *portalGroup ) const
Returns true
if the list model contains the PortalGroup portalGroup.
[override virtual]
QVariant PortalGroupListModel::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 group 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 PortalGroupListModel::errorOccurred (const Esri::ArcGISRuntime::Error &error)
Signal emitted when an error occurs.
- error - Details about the error.
Esri::ArcGISRuntime::PortalGroup *PortalGroupListModel::first() const
Returns the first PortalGroup in the list model.
int PortalGroupListModel::indexOf (Esri::ArcGISRuntime::PortalGroup *portalGroup ) const
Returns the index of the PortalGroup portalGroup.
bool PortalGroupListModel::isEmpty () const
Returns whether the list model is empty (contains no groups).
[signal, since Esri::ArcGISRuntime 100.15]
void PortalGroupListModel::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 PortalGroupListModel::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::PortalGroup *PortalGroupListModel::last() const
Returns the last PortalGroup in the list model.
[override virtual]
int PortalGroupListModel::size() const
Returns the number of PortalGroups contained in the list model.