A list model storing a list of sublayers. More...
|  Header |  #include <ArcGIS | 
|  Since |  Esri | 
|  Inherits |  QAbstract | 
This class was introduced in Esri::ArcGISRuntime 100.0.
Public Types
| enum | Sublayer | 
Public Functions
| virtual | ~ | 
| void | append( | 
| void | clear() | 
| bool | contains( | 
|  Esri | first() const | 
| int | index | 
| void | insert(int index, Esri | 
| bool | is | 
|  Esri | last() const | 
| void | move(int from, int to) | 
| void | remove | 
| void | remove | 
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
Modifying this model (adding, removing, moving) results in updates to any objects that are currently referencing these sublayers.
The model returns data for the following roles:
| Role | Type | Description | SublayerRoles | 
|---|---|---|---|
| name | QString | The sublayer's name. | Sublayer | 
| sublayer | bool | Whether the sublayer is enabled to be visible. | Sublayer | 
| show | bool | Whether the sublayer will be shown in the legend. | Sublayer | 
| sublayer | int | The sublayer's I | Sublayer | 
| min | double | The minumum scale at which the sublayer displays. | Sublayer | 
| max | double | The maximum scale at which the sublayer displays. | Sublayer | 
| sublayer | ArcGIS | The sublayer's type. | Sublayer | 
| can | bool | Whether the sublayer's visibility can be changed. | Sublayer | 
| definition | QString | The sublayer's definition expression (since 100.1) | Sublayer | 
| sublayer | float | The sublayer's opacity (since 100.1) | Sublayer | 
| scale | bool | Whether the sublayer renderers its symbols based on scale (since 100.1) | Sublayer | 
| labels | bool | Whether the sublayer's labels are displayed (since 100.1) | Sublayer | 
Member Type Documentation
enum ArcGISSublayerListModel::SublayerRoles     
This enum specifies the custom roles which can be used with ArcGISSublayerListModel::data.
| Constant | Value | Description | 
|---|---|---|
Esri | Qt | The sublayer's name. | 
Esri | Qt | The sublayer's I | 
Esri | Qt | The minumum scale at which the sublayer displays. | 
Esri | Qt | The maximum scale at which the sublayer displays. | 
Esri | Qt | The sublayer's type. | 
Esri | Qt | Whether the sublayer's visibility can be changed. | 
Esri | Qt | Whether the sublayer is enabled to be visible. | 
Esri | Qt | Whether the sublayer will be shown in the legend. | 
Esri | Qt | The sublayer's definition expression (since 100.1). | 
Esri | Qt | The sublayer's opacity (since 100.1). | 
Esri | Qt | Whether the sublayer renderers its symbols based on scale (since 100.1). | 
Esri | Qt | Whether the sublayer's labels are displayed (since 100.1). | 
Member Function Documentation
[signal] void ArcGISSublayerListModel::errorOccurred (Esri::ArcGISRuntime::Error    error)    
Signal emitted when an error occurs.
- error - Details about the error.
 
[signal] void ArcGISSublayerListModel::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 ArcGISSublayerListModel::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] ArcGISSublayerListModel::~ArcGISSublayerListModel    ()    
Destructor.
void ArcGISSublayerListModel::append(Esri::ArcGISRuntime::ArcGISSublayer     *sublayer)    
Appends a sublayer to the sublayer list model.
[override virtual] Esri::ArcGISRuntime::ArcGISSublayer     *ArcGISSublayerListModel::at(int index) const     
Returns the sublayer at the specified index.
void ArcGISSublayerListModel::clear()    
Removes all sublayers 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 ArcGISSublayerListModel::contains(Esri::ArcGISRuntime::ArcGISSublayer     *sublayer) const    
Returns true if the list model contains the specified sublayer.
[override virtual] QVariant ArcGISSublayerListModel::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 sublayer 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::ArcGISSublayer     *ArcGISSublayerListModel::first() const     
Returns the first sublayer in the list model.
int ArcGISSublayerListModel::indexOf (Esri::ArcGISRuntime::ArcGISSublayer     *sublayer) const    
Returns the index of the sublayer specified.
void ArcGISSublayerListModel::insert(int index, Esri::ArcGISRuntime::ArcGISSublayer     *sublayer)    
Inserts a sublayer at a specified index in the list model.
This method will append to the list model if the index is greater than the current size of the list.
bool ArcGISSublayerListModel::isEmpty () const    
Returns true if the list model contains no sublayers.
Esri::ArcGISRuntime::ArcGISSublayer     *ArcGISSublayerListModel::last() const     
Returns the last sublayer in the list model.
void ArcGISSublayerListModel::move(int from, int to)    
Moves one sublayer from an index in the list model to a different index.
void ArcGISSublayerListModel::removeAt (int index)    
Removes a sublayer at the specified index.
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 ArcGISSublayerListModel::removeOne (Esri::ArcGISRuntime::ArcGISSublayer     *sublayer)    
Removes the specified sublayer 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 ArcGISSublayerListModel::size() const    
Returns the number of sublayers contained in the list model.