Skip To Content ArcGIS for Developers Sign In Dashboard

UniqueValueListModel Class

(Esri::ArcGISRuntime::UniqueValueListModel)

A list model storing a list of unique values available in a unique value renderer. More...

Header: #include <UniqueValueListModel>
Since: Esri::ArcGISRuntime 100.0
Inherits: QAbstractListModel and Iterable<UniqueValue *>

Public Types

enum UniqueValueRoles { UniqueValueDescriptionRole, UniqueValueLabelRole, UniqueValueValuesRole }

Public Functions

~UniqueValueListModel()
void append(UniqueValue *uniqueValue)
UniqueValue *at(int index) const
void clear()
bool contains(UniqueValue *uniqueValue) const
UniqueValue *first() const
int indexOf(UniqueValue *uniqueValue) const
void insert(int index, UniqueValue *uniqueValue)
bool isEmpty() const
UniqueValue *last() const
void move(int from, int to)
void removeAt(int index)
void removeOne(UniqueValue *uniqueValue)
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 uniqueValueAdded(int index)
void uniqueValueRemoved(int index)

Additional Inherited Members

Detailed Description

A list model storing a list of unique values available in a unique value renderer.

Modifying this model (adding, removing, or moving) will update the unique values available in the unique value renderer.

This is a subclass of QAbstractListModel.

The model returns data for the following roles:

RoleTypeDescriptionUniqueValueRoles
descriptionQStringThe description of the unique value.UniqueValueDescriptionRole
labelQStringThe label used to display the unique value.UniqueValueLabelRole
valuesQVariantListThe attribute value or list of values that comprise the unique value.UniqueValueValuesRole

See also UniqueValueRenderer and UniqueValue.

Member Type Documentation

enum UniqueValueListModel::UniqueValueRoles

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

ConstantValueDescription
Esri::ArcGISRuntime::UniqueValueListModel::UniqueValueDescriptionRoleQt::UserRole + 1The description of the unique value.
Esri::ArcGISRuntime::UniqueValueListModel::UniqueValueLabelRoleQt::UserRole + 2The label used to display the unique value.
Esri::ArcGISRuntime::UniqueValueListModel::UniqueValueValuesRoleQt::UserRole + 3The attribute value or list of values that comprise the unique value.

Member Function Documentation

UniqueValueListModel::~UniqueValueListModel()

Destructor.

void UniqueValueListModel::append(UniqueValue *uniqueValue)

Appends the uniqueValue to the unique value list model.

UniqueValue *UniqueValueListModel::at(int index) const

Returns the unique value at the specified index.

void UniqueValueListModel::clear()

Removes all unique values from the list model.

bool UniqueValueListModel::contains(UniqueValue *uniqueValue) const

Returns true if the provided uniqueValue is in the list model.

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

Reimplemented from QAbstractItemModel::data().

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

Signal emitted when an error occurs.

  • error - Details about the error.

UniqueValue *UniqueValueListModel::first() const

Returns the first unique value in the list model.

int UniqueValueListModel::indexOf(UniqueValue *uniqueValue) const

Returns the index of the provided uniqueValue in the list model.

void UniqueValueListModel::insert(int index, UniqueValue *uniqueValue)

Inserts a uniqueValue at a specified index in the list model.

bool UniqueValueListModel::isEmpty() const

Returns true if this list model is empty.

UniqueValue *UniqueValueListModel::last() const

Returns the last unique value in the list model.

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

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

void UniqueValueListModel::removeAt(int index)

Removes a unique value at the specified index in the list model.

void UniqueValueListModel::removeOne(UniqueValue *uniqueValue)

Removes the specified uniqueValue from the list model.

int UniqueValueListModel::size() const

Returns the number of unique values in the model.

[signal] void UniqueValueListModel::uniqueValueAdded(int index)

Signal emitted when a unique value is added to the model.

index is the index of the added unique value.

[signal] void UniqueValueListModel::uniqueValueRemoved(int index)

Signal emitted when a unique value is removed from the model.

index is the index of the removed unique value.


Feedback on this topic?