Skip To Content ArcGIS for Developers Sign In Dashboard

SymbolListModel Class

(Esri::ArcGISRuntime::SymbolListModel)

A list model storing a list of symbols. More...

Header: #include <SymbolListModel>
Since: Esri::ArcGISRuntime 100.0
Inherits: QAbstractListModel and Iterable<Symbol *>

Public Types

enum SymbolRoles { SymbolUrlRole }

Public Functions

~SymbolListModel()
void append(Symbol *symbol)
Symbol *at(int index) const
void clear()
bool contains(Symbol *symbol) const
Symbol *first() const
int indexOf(Symbol *symbol) const
void insert(int index, Symbol *symbol)
bool isEmpty() const
Symbol *last() const
void move(int from, int to)
void removeAt(int index)
void removeOne(Symbol *symbol)
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 symbolAdded(int index)
void symbolRemoved(int index)

Additional Inherited Members

Detailed Description

A list model storing a list of symbols.

Modifying this model (adding, removing, moving) will update the symbols belonging to the model's parent type (i.e. CompositeSymbol).

The model returns data for the following roles:

RoleTypeDescriptionSublayerRoles
symbolUrlQUrlA file URL to the symbol's swatch image.SymbolUrlRole

Member Type Documentation

enum SymbolListModel::SymbolRoles

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

ConstantValueDescription
Esri::ArcGISRuntime::SymbolListModel::SymbolUrlRoleQt::UserRole + 1A file URL to the symbol's swatch image.

Member Function Documentation

SymbolListModel::~SymbolListModel()

Destructor.

void SymbolListModel::append(Symbol *symbol)

Appends a symbol to the symbol list model.

Symbol *SymbolListModel::at(int index) const

Returns the Symbol at the specified index.

void SymbolListModel::clear()

Removes all symbols from the list model.

bool SymbolListModel::contains(Symbol *symbol) const

Returns true if the list model contains the specified symbol.

[virtual] QVariant SymbolListModel::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 SymbolListModel::errorOccurred(Esri::ArcGISRuntime::Error error)

Signal emitted when an error occurs.

  • error - Details about the error.

Symbol *SymbolListModel::first() const

Returns the first symbol in the list model.

int SymbolListModel::indexOf(Symbol *symbol) const

Returns the index of the symbol specified.

void SymbolListModel::insert(int index, Symbol *symbol)

Inserts a symbol 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 SymbolListModel::isEmpty() const

Returns true if the list model contains no symbols.

Symbol *SymbolListModel::last() const

Returns the last symbol in the list model.

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

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

void SymbolListModel::removeAt(int index)

Removes a symbol at the specified index.

void SymbolListModel::removeOne(Symbol *symbol)

Removes the specified symbol from the list model.

int SymbolListModel::size() const

Returns the number of symbols contained in the list model.

[signal] void SymbolListModel::symbolAdded(int index)

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

index is the index of the added symbol.

[signal] void SymbolListModel::symbolRemoved(int index)

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

index is the index of the removed symbol.


Feedback on this topic?