A container class storing a list of UtilityNetwork. More...
Header: | #include <UtilityNetworkListModel.h> |
Since: | Esri::ArcGISRuntime 100.10 |
Inherits: | QAbstractListModel and Esri::ArcGISRuntime::Iterable |
This class was introduced in Esri::ArcGISRuntime 100.10.
Public Types
enum | UtilityNetworkRoles { UtilityNetworkDefinitionRole, UtilityNetworkName } |
Public Functions
virtual | ~UtilityNetworkListModel() override |
void | append(Esri::ArcGISRuntime::UtilityNetwork *utilityNetwork) |
void | clear() |
bool | contains(Esri::ArcGISRuntime::UtilityNetwork *utilityNetwork) const |
Esri::ArcGISRuntime::UtilityNetwork * | first() const |
int | indexOf(Esri::ArcGISRuntime::UtilityNetwork *utilityNetwork) const |
void | insert(int index, Esri::ArcGISRuntime::UtilityNetwork *utilityNetwork) |
bool | isEmpty() const |
Esri::ArcGISRuntime::UtilityNetwork * | last() const |
void | move(int from, int to) |
void | removeAt(int index) |
void | removeOne(Esri::ArcGISRuntime::UtilityNetwork *utilityNetwork) |
Reimplemented Public Functions
virtual Esri::ArcGISRuntime::UtilityNetwork * | 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 | UtilityNetworkRoles |
---|---|---|---|
definition | UtilityNetworkDefinition | The UtilityNetworkDefinition of the UtilityNetwork | UtilityNetworkDefinitionRole |
name | QString | The name of the UtilityNetwork | UtilityNetworkName |
See also UtilityNetwork.
Member Type Documentation
enum UtilityNetworkListModel::UtilityNetworkRoles
This enum specifies the custom roles that can be used with UtilityNetworkListModel::data.
Constant | Value | Description |
---|---|---|
Esri::ArcGISRuntime::UtilityNetworkListModel::UtilityNetworkDefinitionRole | Qt::UserRole + 1 | The UtilityNetworkDefinition of the UtilityNetwork. |
Esri::ArcGISRuntime::UtilityNetworkListModel::UtilityNetworkName | Qt::UserRole + 2 | The name of the UtilityNetwork. |
Member Function Documentation
[signal]
void UtilityNetworkListModel::errorOccurred (Esri::ArcGISRuntime::Error error)
Signal emitted when an error occurs.
- error - Details about the error
[signal]
void UtilityNetworkListModel::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 UtilityNetworkListModel::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]
UtilityNetworkListModel::~UtilityNetworkListModel ()
Destructor.
void UtilityNetworkListModel::append(Esri::ArcGISRuntime::UtilityNetwork *utilityNetwork )
Appends the utilityNetwork to the utility trace function list model.
[override virtual]
Esri::ArcGISRuntime::UtilityNetwork *UtilityNetworkListModel::at(int index) const
Returns the utility trace function at the specified index.
void UtilityNetworkListModel::clear()
Removes all utility networks 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 UtilityNetworkListModel::contains(Esri::ArcGISRuntime::UtilityNetwork *utilityNetwork ) const
Returns whether the provided utilityNetwork is in the list model.
[override virtual]
QVariant UtilityNetworkListModel::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 trace function 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::UtilityNetwork *UtilityNetworkListModel::first() const
Returns the first utility trace function in the list model.
int UtilityNetworkListModel::indexOf (Esri::ArcGISRuntime::UtilityNetwork *utilityNetwork ) const
Returns the index of the provided utilityNetwork in the list model.
void UtilityNetworkListModel::insert(int index, Esri::ArcGISRuntime::UtilityNetwork *utilityNetwork )
Inserts a utilityNetwork at a specified index in the list model.
bool UtilityNetworkListModel::isEmpty () const
Returns true
if this list model is empty.
Esri::ArcGISRuntime::UtilityNetwork *UtilityNetworkListModel::last() const
Returns the last utility trace function in the list model.
void UtilityNetworkListModel::move(int from, int to)
Moves one utility trace function from an index in the list model to a different index.
void UtilityNetworkListModel::removeAt (int index)
Removes a utility trace function 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 UtilityNetworkListModel::removeOne (Esri::ArcGISRuntime::UtilityNetwork *utilityNetwork )
Removes the specified utilityNetwork 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 UtilityNetworkListModel::size() const
Returns the number of utility networks in the model.