Skip To Content ArcGIS for Developers Sign In Dashboard

LabelDefinitionListModel Class


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

Header: #include <LabelDefinitionListModel>
Since: Esri::ArcGISRuntime 100.1
Inherits: QAbstractListModel and Iterable<LabelDefinition *>

Public Types

enum LabelDefinitionRoles { LabelDefinitionJsonRole }

Public Functions

void append(LabelDefinition *labelDefinition)
LabelDefinition *at(int index) const
void clear()
bool contains(LabelDefinition *labelDefinition) const
LabelDefinition *first() const
int indexOf(LabelDefinition *labelDefinition) const
void insert(int index, LabelDefinition *labelDefinition)
bool isEmpty() const
LabelDefinition *last() const
void move(int from, int to)
void removeAt(int index)
void removeOne(LabelDefinition *labelDefinition)
int size() const

Reimplemented Public Functions

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


void errorOccurred(Esri::ArcGISRuntime::Error error)
void labelDefinitionAdded(int index)
void labelDefinitionRemoved(int index)

Additional Inherited Members

Detailed Description

A list model storing a list of LabelDefinitions.

Modifying this model (adding, removing, moving) will update the LabelDefinitions belonging to the model's parent type (ArcGISMapImageSublayer, FeatureLayer or GraphicsOverlay).

The model returns data for the following roles:

LabelDefinitionJsonQStringA LabelDefinition's JSON.LabelDefinitionJsonRole

Member Type Documentation

enum LabelDefinitionListModel::LabelDefinitionRoles

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

Esri::ArcGISRuntime::LabelDefinitionListModel::LabelDefinitionJsonRoleQt::UserRole + 1A LabelDefinition's JSON string.

Member Function Documentation



void LabelDefinitionListModel::append(LabelDefinition *labelDefinition)

Appends a labelDefinition to the LabelDefinition list model.

LabelDefinition *LabelDefinitionListModel::at(int index) const

Returns the LabelDefinition at the specified index.

void LabelDefinitionListModel::clear()

Removes all LabelDefinitions from the list model.

bool LabelDefinitionListModel::contains(LabelDefinition *labelDefinition) const

Returns true if the list model contains the specified labelDefinition.

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

Reimplemented from QAbstractItemModel::data().

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

Signal emitted when an error occurs.

  • error - Details about the error.

LabelDefinition *LabelDefinitionListModel::first() const

Returns the first LabelDefinition in the list model.

int LabelDefinitionListModel::indexOf(LabelDefinition *labelDefinition) const

Returns the index of the labelDefinition specified.

void LabelDefinitionListModel::insert(int index, LabelDefinition *labelDefinition)

Inserts a labelDefinition 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 LabelDefinitionListModel::isEmpty() const

Returns true if the list model contains no LabelDefinitions.

[signal] void LabelDefinitionListModel::labelDefinitionAdded(int index)

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

[signal] void LabelDefinitionListModel::labelDefinitionRemoved(int index)

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

LabelDefinition *LabelDefinitionListModel::last() const

Returns the last LabelDefinition in the list model.

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

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

void LabelDefinitionListModel::removeAt(int index)

Removes a LabelDefinition at the specified index.

void LabelDefinitionListModel::removeOne(LabelDefinition *labelDefinition)

Removes the specified labelDefinition from the list model.

int LabelDefinitionListModel::size() const

Returns the number of LabelDefinitions contained in the list model.

Feedback on this topic?