Represents the list of comments relating to a PortalItem. More...
|  Header |  #include <Portal | 
|  Since |  Esri | 
|  Inherits |  QAbstract | 
This class was introduced in Esri::ArcGISRuntime 100.0.
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 QVariant | data(const QModel | 
| virtual int | size() const override | 
Signals
| void | error | 
| void | item | 
| void | item | 
Detailed Description
Comments can be retrieved by calling fetchComments on a PortalItem and accessed via the {PortalItem::comments} {comments} method after the task is complete.
The model returns data for the following roles:
| Role | Type | Description | SublayerRoles | 
|---|---|---|---|
| comment | QString | The text of the comment. | Portal | 
| comment | QString | The I | Portal | 
| created | QDate | The date the comment was created. | Portal | 
| owner | QString | The username of the user that added the comment. | Portal | 
Example:
Accessing various roles of the model from within a QML delegate:
Text{ anchors.fill: parent // acccess the comment, commentId, created and owner roles of the model text: "comment:" + comment + "; ID:" + commentId + "; created:" + created + "; owner: " + owner wrapMode: Text.WrapAnywhere }
See also PortalUser, PortalItemComment, and PortalItem.
Member Type Documentation
enum PortalItemCommentListModel::PortalItemCommentRoles        
This enum specifies the custom roles which can be used with PortalItemCommentListModel::data.
| Constant | Value | Description | 
|---|---|---|
Esri | Qt | The text of the comment. | 
Esri | Qt | The I | 
Esri | Qt | The date the comment was created. | 
Esri | Qt | The username of the user that added the comment. | 
Member Function Documentation
[signal] void PortalItemCommentListModel::errorOccurred (Esri::ArcGISRuntime::Error    error)     
Signal emitted when an error occurs.
- error - Details about the error.
 
[signal] void PortalItemCommentListModel::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] void PortalItemCommentListModel::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.
[override virtual] PortalItemCommentListModel::~PortalItemCommentListModel     ()     
Destructor.
[override virtual] Esri::ArcGISRuntime::PortalItemComment      *PortalItemCommentListModel::at(int index) const      
Returns the PortalItemComment at the specified index.
bool PortalItemCommentListModel::contains(Esri::ArcGISRuntime::PortalItemComment      *portalItemComment  ) const     
Returns true if the list model contains the PortalItemComment portalItemComment.
[override virtual] QVariant PortalItemCommentListModel::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 comment referred to by the index.
- index. The index in the model for which to return data.
 - role. The role for which to return data.
 
Esri::ArcGISRuntime::PortalItemComment      *PortalItemCommentListModel::first() const      
Returns the first PortalItemComment in the list model.
int PortalItemCommentListModel::indexOf (Esri::ArcGISRuntime::PortalItemComment      *portalItemComment  ) const     
Returns the index of the PortalItemComment portalItemComment.
bool PortalItemCommentListModel::isEmpty () const     
Returns whether the list model is empty (contains no comments).
Esri::ArcGISRuntime::PortalItemComment      *PortalItemCommentListModel::last() const      
Returns the last PortalItemComment in the list model.
[override virtual] int PortalItemCommentListModel::size() const     
Returns the number of comments contained in the list model.