A container class storing a list of UtilityAssetTypes. More...
Header: | #include <UtilityAssetTypeListModel.h> |
Since: | Esri::ArcGISRuntime 100.9 |
Inherits: | QAbstractListModel and Esri::ArcGISRuntime::Iterable |
This class was introduced in Esri::ArcGISRuntime 100.9.
Public Types
enum | UtilityAssetTypeRoles { UtilityAssetTypeAssociationRole, UtilityAssetTypeCode, UtilityAssetTypeContainerViewScale, UtilityAssetTypeName } |
Public Functions
virtual | ~UtilityAssetTypeListModel() override |
void | append(Esri::ArcGISRuntime::UtilityAssetType *utilityAssetType) |
void | clear() |
bool | contains(Esri::ArcGISRuntime::UtilityAssetType *utilityAssetType) const |
Esri::ArcGISRuntime::UtilityAssetType * | first() const |
int | indexOf(Esri::ArcGISRuntime::UtilityAssetType *utilityAssetType) const |
void | insert(int index, Esri::ArcGISRuntime::UtilityAssetType *utilityAssetType) |
bool | isEmpty() const |
Esri::ArcGISRuntime::UtilityAssetType * | last() const |
void | move(int from, int to) |
void | removeAt(int index) |
void | removeOne(Esri::ArcGISRuntime::UtilityAssetType *utilityAssetType) |
Reimplemented Public Functions
virtual Esri::ArcGISRuntime::UtilityAssetType * | at(int index) const override |
virtual QVariant | data(const QModelIndex &index, int role = Qt::DisplayRole) const override |
virtual int | size() const override |
Signals
void | errorOccurred(Esri::ArcGISRuntime::Error error) |
void | itemAdded(int index) |
void | itemRemoved(int index) |
Detailed Description
The model returns data for the following roles:
Role | Type | Description | UtilityAssetTypeRoles |
---|---|---|---|
associationRole | UtilityAssociationRole | The associationRole of the UtilityAssetType. | UtilityAssetTypeAssociationRole |
code | int | The attribute domain value code of the UtilityAssetType. | UtilityAssetTypeCode |
containerViewScale | double | The container view scale of the UtilityAssetType | UtilityAssetTypeContainerViewScale |
name | QString | The name of the UtilityAssetType. | UtilityAssetTypeName |
See also UtilityAssetType.
Member Type Documentation
enum UtilityAssetTypeListModel::UtilityAssetTypeRoles
This enum specifies the custom roles which can be used with UtilityAssetTypeListModel::data.
Constant | Value | Description |
---|---|---|
Esri::ArcGISRuntime::UtilityAssetTypeListModel::UtilityAssetTypeAssociationRole | Qt::UserRole + 1 | The associationRole of the UtilityAssetType. |
Esri::ArcGISRuntime::UtilityAssetTypeListModel::UtilityAssetTypeCode | Qt::UserRole + 2 | The attribute domain value code of the UtilityAssetType. |
Esri::ArcGISRuntime::UtilityAssetTypeListModel::UtilityAssetTypeContainerViewScale | Qt::UserRole + 3 | The container view scale of the UtilityAssetType |
Esri::ArcGISRuntime::UtilityAssetTypeListModel::UtilityAssetTypeName | Qt::UserRole + 4 | The name of the UtilityAssetType. |
Member Function Documentation
[signal]
void UtilityAssetTypeListModel::errorOccurred (Esri::ArcGISRuntime::Error error)
Signal emitted when an error occurs.
- error - Details about the error.
[signal]
void UtilityAssetTypeListModel::itemAdded (int index)
Signal emitted when an item is added to the list.
index is the index of the added item.
This function was introduced in Esri::ArcGISRuntime 100.15.
[signal]
void UtilityAssetTypeListModel::itemRemoved (int index)
Signal emitted when an item is removed from the list.
index is the index of the removed item.
This function was introduced in Esri::ArcGISRuntime 100.15.
[override virtual]
UtilityAssetTypeListModel::~UtilityAssetTypeListModel ()
Destructor.
void UtilityAssetTypeListModel::append(Esri::ArcGISRuntime::UtilityAssetType *utilityAssetType )
Appends the utilityAssetType to the utility asset types list model.
[override virtual]
Esri::ArcGISRuntime::UtilityAssetType *UtilityAssetTypeListModel::at(int index) const
Returns the utility asset type at the specified index.
void UtilityAssetTypeListModel::clear()
Removes all utility asset types from the list model.
List models do not take ownership of the objects they contain. Therefore, removing or clearing objects from the list model will not delete those objects. An RAII technique should be used to ensure that memory is properly deallocated.
bool UtilityAssetTypeListModel::contains(Esri::ArcGISRuntime::UtilityAssetType *utilityAssetType ) const
Returns whether the provided utilityAssetType is in the list model.
[override virtual]
QVariant UtilityAssetTypeListModel::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 utility asset type 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::UtilityAssetType *UtilityAssetTypeListModel::first() const
Returns the first utility asset type in the list model.
int UtilityAssetTypeListModel::indexOf (Esri::ArcGISRuntime::UtilityAssetType *utilityAssetType ) const
Returns the index of the provided utilityAssetType in the list model.
void UtilityAssetTypeListModel::insert(int index, Esri::ArcGISRuntime::UtilityAssetType *utilityAssetType )
Inserts a utilityAssetType at a specified index in the list model.
bool UtilityAssetTypeListModel::isEmpty () const
Returns true
if this list model is empty.
Esri::ArcGISRuntime::UtilityAssetType *UtilityAssetTypeListModel::last() const
Returns the last utility asset type in the list model.
void UtilityAssetTypeListModel::move(int from, int to)
Moves one utility asset type from an index in the list model to a different index.
void UtilityAssetTypeListModel::removeAt (int index)
Removes a utility asset type at the specified index in the list model.
List models do not take ownership of the objects they contain. Therefore, removing or clearing objects from the list model will not delete those objects. An RAII technique should be used to ensure that memory is properly deallocated.
void UtilityAssetTypeListModel::removeOne (Esri::ArcGISRuntime::UtilityAssetType *utilityAssetType )
Removes the specified utilityAssetType from the list model.
List models do not take ownership of the objects they contain. Therefore, removing or clearing objects from the list model will not delete those objects. An RAII technique should be used to ensure that memory is properly deallocated.
[override virtual]
int UtilityAssetTypeListModel::size() const
Returns the number of utility asset types in the model.