Skip To Content ArcGIS for Developers Sign In Dashboard

SymbolLayerListModel Class

(Esri::ArcGISRuntime::SymbolLayerListModel)

A list model storing a list of symbol layers available in a multi-layer symbol. More...

Header: #include <SymbolLayerListModel>
Since: Esri::ArcGISRuntime 100.5
Inherits: QAbstractListModel and Iterable<SymbolLayer *>

Public Types

enum SymbolLayerRoles { SymbolLayerTypeRole, ColorLockedRole, EnabledRole }

Public Functions

~SymbolLayerListModel()
void append(SymbolLayer *symbolLayer)
void append(const QList<SymbolLayer *> &symbolLayers)
SymbolLayer *at(int index) const
void clear()
bool contains(SymbolLayer *symbolLayer) const
SymbolLayer *first() const
int indexOf(SymbolLayer *symbolLayer) const
void insert(int index, SymbolLayer *symbolLayer)
bool isEmpty() const
SymbolLayer *last() const
void move(int from, int to)
void removeAt(int index)
void removeOne(SymbolLayer *symbolLayer)
int size() const

Reimplemented Public Functions

virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const

Signals

void errorOccurred(Esri::ArcGISRuntime::Error error)
void symbolLayerAdded(int index)
void symbolLayerRemoved(int index)

Additional Inherited Members

Detailed Description

A list model storing a list of symbol layers available in a multi-layer symbol.

Modifying this model (adding, removing, moving) will update the MultiLayerSymbol.

The model returns data for the following roles:

RoleTypeDescriptionSymbolLayerRoles
symbolLayerTypeEsri::ArcGISRuntime::SymbolLayerTypeThe type of symbol layer. The role is read-only.SymbolLayerTypeRole
colorLockedboolWhether the symbol layer has been color locked.ColorLockedRole
enabledboolWhether the symbol layer is enabled.EnabledRole

Member Type Documentation

enum SymbolLayerListModel::SymbolLayerRoles

This enum specifies the custom roles which can be used with SymbolLayerListModel::data.

ConstantValueDescription
Esri::ArcGISRuntime::SymbolLayerListModel::SymbolLayerTypeRoleQt::UserRole + 1The type of symbol layer.
Esri::ArcGISRuntime::SymbolLayerListModel::ColorLockedRoleQt::UserRole + 2If the symbol layer is color locked.
Esri::ArcGISRuntime::SymbolLayerListModel::EnabledRoleQt::UserRole + 3If the symbol layer is enabled.

Member Function Documentation

SymbolLayerListModel::~SymbolLayerListModel()

Destructor.

void SymbolLayerListModel::append(SymbolLayer *symbolLayer)

Appends symbolLayer to the symbol layer list model.

void SymbolLayerListModel::append(const QList<SymbolLayer *> &symbolLayers)

Appends symbolLayers to the symbol layer list model.

SymbolLayer *SymbolLayerListModel::at(int index) const

Returns the SymbolLayer at the specified index.

void SymbolLayerListModel::clear()

Removes all symbol layers from the list model.

bool SymbolLayerListModel::contains(SymbolLayer *symbolLayer) const

Returns true if the list model contains the specified symbolLayer.

[virtual] QVariant SymbolLayerListModel::data(const QModelIndex &index, int role = Qt::DisplayRole) const

Reimplemented from QAbstractItemModel::data().

Returns the data stored under the given role for the symbol 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 SymbolLayerListModel::errorOccurred(Esri::ArcGISRuntime::Error error)

Signal emitted when an error occurs.

  • error - Details about the error.

SymbolLayer *SymbolLayerListModel::first() const

Returns the first symbol layer in the list model.

int SymbolLayerListModel::indexOf(SymbolLayer *symbolLayer) const

Returns the index of the symbolLayer specified.

void SymbolLayerListModel::insert(int index, SymbolLayer *symbolLayer)

Inserts a symbolLayer 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 SymbolLayerListModel::isEmpty() const

Returns true if the list model contains no symbol layers.

SymbolLayer *SymbolLayerListModel::last() const

Returns the last symbol layer in the list model.

void SymbolLayerListModel::move(int from, int to)

Moves one symbolLayer from an index in the list model to a different index.

void SymbolLayerListModel::removeAt(int index)

Removes a symbol at the specified index.

void SymbolLayerListModel::removeOne(SymbolLayer *symbolLayer)

Removes the specified symbolLayer from the list model.

int SymbolLayerListModel::size() const

Returns the number of symbol layers contained in the list model.

[signal] void SymbolLayerListModel::symbolLayerAdded(int index)

Signal emitted when a SymbolLayer is added to the list model.

index is the index of the added symbol layer.

[signal] void SymbolLayerListModel::symbolLayerRemoved(int index)

Signal emitted when a SymbolLayer is removed from the list model.

index is the index of the removed symbol layer.


Feedback on this topic?