A list model storing a list of analyses available in an AnalysisOverlay. More...
Header: | #include <AnalysisListModel.h> |
Since: | Esri::ArcGISRuntime 100.2 |
Inherits: | QAbstractListModel and Esri::ArcGISRuntime::Iterable |
Public Types
enum | AnalysisRoles { AnalysisVisibleRole, AnalysisTypeRole } |
Public Functions
virtual | ~AnalysisListModel() override |
void | append(Esri::ArcGISRuntime::Analysis *analysis) |
void | clear() |
bool | contains(Esri::ArcGISRuntime::Analysis *analysis) const |
Esri::ArcGISRuntime::Analysis * | first() const |
int | indexOf(Esri::ArcGISRuntime::Analysis *analysis) const |
void | insert(int index, Esri::ArcGISRuntime::Analysis *analysis) |
bool | isEmpty() const |
Esri::ArcGISRuntime::Analysis * | last() const |
void | move(int from, int to) |
void | removeAt(int index) |
void | removeOne(Esri::ArcGISRuntime::Analysis *analysis) |
Reimplemented Public Functions
virtual Esri::ArcGISRuntime::Analysis * | 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(const Esri::ArcGISRuntime::Error &error) |
void | itemAdded(int index) |
void | itemRemoved(int index) |
Detailed Description
Modifying this model (adding, removing, moving) will update the analyses available in the AnalysisOverlay.
The model returns data for the following roles:
Role | Type | Description | AnalysisRoles |
---|---|---|---|
analysisVisible | bool | The analysis' visibility. | AnalysisVisibleRole |
analysisType | AnalysisType | The analysis type. | AnalysisTypeRole |
Member Type Documentation
enum AnalysisListModel::AnalysisRoles
This enum specifies the custom roles which can be used with AnalysisListModel::data.
Constant | Value | Description |
---|---|---|
Esri::ArcGISRuntime::AnalysisListModel::AnalysisVisibleRole | Qt::UserRole + 1 | The analysis' visibility. |
Esri::ArcGISRuntime::AnalysisListModel::AnalysisTypeRole | 258 | The analysis type. |
Member Function Documentation
[override virtual]
AnalysisListModel::~AnalysisListModel ()
Destructor.
void AnalysisListModel::append(Esri::ArcGISRuntime::Analysis *analysis)
Appends an analysis to the analysis list model.
[override virtual]
Esri::ArcGISRuntime::Analysis *AnalysisListModel::at(int index) const
Returns the analysis
at the specified index.
void AnalysisListModel::clear()
Removes all analyses 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 AnalysisListModel::contains(Esri::ArcGISRuntime::Analysis *analysis) const
Returns true
if the list model contains the specified analysis.
[override virtual]
QVariant AnalysisListModel::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 analysis referred to by the index.
- index. The index in the model for which to return data.
- role. The role for which to return data.
An empty value is returned if the specified index is out of range.
[signal]
void AnalysisListModel::errorOccurred (const Esri::ArcGISRuntime::Error &error)
Signal emitted when an error occurs.
- error - Details about the error.
Esri::ArcGISRuntime::Analysis *AnalysisListModel::first() const
Returns the first analysis in the list model.
int AnalysisListModel::indexOf (Esri::ArcGISRuntime::Analysis *analysis) const
Returns the index of the analysis specified.
void AnalysisListModel::insert(int index, Esri::ArcGISRuntime::Analysis *analysis)
Inserts an analysis at a specified index in the list model.
This method will append to the list if the index is greater than the current size of the list model.
bool AnalysisListModel::isEmpty () const
Returns true
if the list model contains no analyses.
[signal, since Esri::ArcGISRuntime 100.15]
void AnalysisListModel::itemAdded (int index)
Signal emitted when an item is added to the list model.
- index - The index of the added item.
This function was introduced in Esri::ArcGISRuntime 100.15.
[signal, since Esri::ArcGISRuntime 100.15]
void AnalysisListModel::itemRemoved (int index)
Signal emitted when an item is removed from the list model.
- index - The index of the removed item.
This function was introduced in Esri::ArcGISRuntime 100.15.
Esri::ArcGISRuntime::Analysis *AnalysisListModel::last() const
Returns the last analysis in the list model.
void AnalysisListModel::move(int from, int to)
Moves one analysis from an index in the list model to a different index.
void AnalysisListModel::removeAt (int index)
Removes an analysis at the specified index.
No analysis will be removed if the specified index is out of range.
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 AnalysisListModel::removeOne (Esri::ArcGISRuntime::Analysis *analysis)
Removes the specified analysis 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 AnalysisListModel::size() const
Returns the number of analyses contained in the list model.