A list model storing a list of subtype sublayers. More...
Header: | #include <SubtypeSublayerListModel.h> |
Since: | Esri::ArcGISRuntime 100.7 |
Inherits: | QAbstractListModel and Esri::ArcGISRuntime::Iterable |
Public Types
enum | SubtypeSublayerRoles { SubtypeSublayerNameRole, SubtypeSublayerIdRole, SubtypeSublayerMinScaleRole, SubtypeSublayerMaxScaleRole, SubtypeSublayerTypeRole, …, SubtypeSublayerLabelsEnabledRole } |
Public Functions
virtual | ~SubtypeSublayerListModel() override |
void | append(Esri::ArcGISRuntime::SubtypeSublayer *subtypeSublayer) |
void | clear() |
bool | contains(Esri::ArcGISRuntime::SubtypeSublayer *subtypeSublayer) const |
Esri::ArcGISRuntime::SubtypeSublayer * | first() const |
int | indexOf(Esri::ArcGISRuntime::SubtypeSublayer *subtypeSublayer) const |
void | insert(int index, Esri::ArcGISRuntime::SubtypeSublayer *subtypeSublayer) |
bool | isEmpty() const |
Esri::ArcGISRuntime::SubtypeSublayer * | last() const |
void | move(int from, int to) |
void | removeAt(int index) |
void | removeOne(Esri::ArcGISRuntime::SubtypeSublayer *subtypeSublayer) |
Reimplemented Public Functions
virtual Esri::ArcGISRuntime::SubtypeSublayer * | 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) results in updates to any objects that are currently referencing these subtype sublayers.
The model returns data for the following roles:
Role | Type | Description | SubtypeSublayerRoles |
---|---|---|---|
name | QString | The subtypeSublayer's name. | SublayerNameRole |
sublayerVisible | bool | Whether the subtypeSublayer is enabled to be visible. | SublayerVisibleRole |
showInLegend | bool | Whether the subtypeSublayer will be shown in the legend. | SublayerShowInLegendRole |
sublayerId | int | The subtypeSublayer's ID. | SublayerIdRole |
minScale | double | The minumum scale at which the subtypeSublayer displays. | SublayerMinScaleRole |
maxScale | double | The maximum scale at which the subtypeSublayer displays. | SublayerMaxScaleRole |
sublayerType | ArcGISSublayerType | The subtypeSublayer's type. | SublayerTypeRole |
canChangeVisibility | bool | Whether the subtypeSublayer's visibility can be changed. | SublayerCanChangeVisibilityRole |
definitionExpression | QString | The subtypeSublayer's definition expression | SublayerDefinitionExpressionRole |
sublayerOpacity | float | The subtypeSublayer's opacity | SublayerOpacityRole |
scaleSymbols | bool | Whether the subtypeSublayer renderers its symbols based on scale | SublayerScaleSymbolsRole |
labelsEnabled | bool | Whether the subtypeSublayer's labels are displayed | SublayerLabelsEnabledRole |
Member Type Documentation
enum SubtypeSublayerListModel::SubtypeSublayerRoles
This enum specifies the custom roles which can be used with SubtypeSublayerListModel::data.
Constant | Value | Description |
---|---|---|
Esri::ArcGISRuntime::SubtypeSublayerListModel::SubtypeSublayerNameRole | Qt::UserRole + 1 | The subtypeSublayer's name. |
Esri::ArcGISRuntime::SubtypeSublayerListModel::SubtypeSublayerIdRole | Qt::UserRole + 2 | The subtypeSublayer's ID. |
Esri::ArcGISRuntime::SubtypeSublayerListModel::SubtypeSublayerMinScaleRole | Qt::UserRole + 3 | The minumum scale at which the subtypeSublayer displays. |
Esri::ArcGISRuntime::SubtypeSublayerListModel::SubtypeSublayerMaxScaleRole | Qt::UserRole + 4 | The maximum scale at which the subtypeSublayer displays. |
Esri::ArcGISRuntime::SubtypeSublayerListModel::SubtypeSublayerTypeRole | Qt::UserRole + 5 | The subtypeSublayer's type. |
Esri::ArcGISRuntime::SubtypeSublayerListModel::SubtypeSublayerCanChangeVisibilityRole | Qt::UserRole + 6 | Whether the subtypeSublayer's visibility can be changed. |
Esri::ArcGISRuntime::SubtypeSublayerListModel::SubtypeSublayerVisibleRole | Qt::UserRole + 7 | Whether the subtypeSublayer is enabled to be visible. |
Esri::ArcGISRuntime::SubtypeSublayerListModel::SubtypeSublayerShowInLegendRole | Qt::UserRole + 8 | Whether the subtypeSublayer will be shown in the legend. |
Esri::ArcGISRuntime::SubtypeSublayerListModel::SubtypeSublayerDefinitionExpressionRole | Qt::UserRole + 9 | The subtypeSublayer's definition expression. |
Esri::ArcGISRuntime::SubtypeSublayerListModel::SubtypeSublayerOpacityRole | Qt::UserRole + 10 | The subtypeSublayer's opacity. |
Esri::ArcGISRuntime::SubtypeSublayerListModel::SubtypeSublayerScaleSymbolsRole | Qt::UserRole + 11 | Whether the subtypeSublayer renderers its symbols based on scale. |
Esri::ArcGISRuntime::SubtypeSublayerListModel::SubtypeSublayerLabelsEnabledRole | Qt::UserRole + 12 | Whether the subtypeSublayer's labels are displayed. |
Member Function Documentation
[override virtual]
SubtypeSublayerListModel::~SubtypeSublayerListModel ()
Destructor.
void SubtypeSublayerListModel::append(Esri::ArcGISRuntime::SubtypeSublayer *subtypeSublayer )
Appends a subtypeSublayer to the subtypeSublayer list model.
[override virtual]
Esri::ArcGISRuntime::SubtypeSublayer *SubtypeSublayerListModel::at(int index) const
Returns the subtypeSublayer
at the specified index.
void SubtypeSublayerListModel::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 SubtypeSublayerListModel::contains(Esri::ArcGISRuntime::SubtypeSublayer *subtypeSublayer ) const
Returns true
if the list model contains the specified subtypeSublayer.
[override virtual]
QVariant SubtypeSublayerListModel::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 subtypeSublayer referred to by the index.
- index. The index in the model for which to return data.
- role. The role for which to return data.
[signal]
void SubtypeSublayerListModel::errorOccurred (const Esri::ArcGISRuntime::Error &error)
Signal emitted when an error occurs.
- error - Details about the error.
Esri::ArcGISRuntime::SubtypeSublayer *SubtypeSublayerListModel::first() const
Returns the first subtypeSublayer in the list model.
int SubtypeSublayerListModel::indexOf (Esri::ArcGISRuntime::SubtypeSublayer *subtypeSublayer ) const
Returns the index of the subtypeSublayer specified.
void SubtypeSublayerListModel::insert(int index, Esri::ArcGISRuntime::SubtypeSublayer *subtypeSublayer )
Inserts a subtypeSublayer 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 SubtypeSublayerListModel::isEmpty () const
Returns true
if the list model contains no sublayers.
[signal, since Esri::ArcGISRuntime 100.15]
void SubtypeSublayerListModel::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, since Esri::ArcGISRuntime 100.15]
void SubtypeSublayerListModel::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.
Esri::ArcGISRuntime::SubtypeSublayer *SubtypeSublayerListModel::last() const
Returns the last subtypeSublayer in the list model.
void SubtypeSublayerListModel::move(int from, int to)
Moves one subtypeSublayer from an index in the list model to a different index.
void SubtypeSublayerListModel::removeAt (int index)
Removes a subtypeSublayer 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 SubtypeSublayerListModel::removeOne (Esri::ArcGISRuntime::SubtypeSublayer *subtypeSublayer )
Removes the specified subtypeSublayer 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 SubtypeSublayerListModel::size() const
Returns the number of sublayers contained in the list model.