Skip To Content ArcGIS for Developers Sign In Dashboard

ClassBreakListModel Class

(Esri::ArcGISRuntime::ClassBreakListModel)

A list model storing a list of class breaks available in a class breaks renderer. More...

Header: #include <ClassBreakListModel>
Since: Esri::ArcGISRuntime 100.0
Inherits: QAbstractListModel and Iterable<ClassBreak *>

Public Types

enum ClassBreakRoles { ClassBreakDescriptionRole, ClassBreakLabelRole, ClassBreakMaxValueRole, ClassBreakMinValueRole }

Public Functions

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

Reimplemented Public Functions

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

Signals

void classBreakAdded(int index)
void classBreakRemoved(int index)
void errorOccurred(Esri::ArcGISRuntime::Error error)

Additional Inherited Members

Detailed Description

A list model storing a list of class breaks available in a class breaks renderer.

Modifying this model (adding, removing, or moving) will update the class breaks available in the class breaks renderer.

This is a subclass of QAbstractListModel.

The model returns data for the following roles:

RoleTypeDescriptionClassBreakRoles
descriptionQStringThe description of the class break.ClassBreakDescriptionRole
labelQStringThe label used to display the class break.ClassBreakLabelRole
maxValuedoubleThe maximum value of the class break.ClassBreakMaxValueRole
minValuedoubleThe minimum value of the class break.ClassBreakMinValueRole

See also ClassBreaksRenderer and ClassBreak.

Member Type Documentation

enum ClassBreakListModel::ClassBreakRoles

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

ConstantValueDescription
Esri::ArcGISRuntime::ClassBreakListModel::ClassBreakDescriptionRoleQt::UserRole + 1The description of the class break.
Esri::ArcGISRuntime::ClassBreakListModel::ClassBreakLabelRoleQt::UserRole + 2The label used to display the class break.
Esri::ArcGISRuntime::ClassBreakListModel::ClassBreakMaxValueRoleQt::UserRole + 3The maximum value of the class break.
Esri::ArcGISRuntime::ClassBreakListModel::ClassBreakMinValueRoleQt::UserRole + 4The minimum value of the class break.

Member Function Documentation

ClassBreakListModel::~ClassBreakListModel()

Destructor.

void ClassBreakListModel::append(ClassBreak *classBreak)

Appends the classBreak to the class break list model.

ClassBreak *ClassBreakListModel::at(int index) const

Returns the class break at the specified index.

[signal] void ClassBreakListModel::classBreakAdded(int index)

Signal emitted when a class break is added to the model.

index is the index of the added class break.

[signal] void ClassBreakListModel::classBreakRemoved(int index)

Signal emitted when a class break is removed from the model.

index is the index of the removed class break.

void ClassBreakListModel::clear()

Removes all class breaks from the list model.

bool ClassBreakListModel::contains(ClassBreak *classBreak) const

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

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

Reimplemented from QAbstractItemModel::data().

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

Signal emitted when an error occurs.

  • error - Details about the error.

ClassBreak *ClassBreakListModel::first() const

Returns the first class break in the list model.

int ClassBreakListModel::indexOf(ClassBreak *classBreak) const

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

void ClassBreakListModel::insert(int index, ClassBreak *classBreak)

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

bool ClassBreakListModel::isEmpty() const

Returns true if this list model is empty.

ClassBreak *ClassBreakListModel::last() const

Returns the last class break in the list model.

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

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

void ClassBreakListModel::removeAt(int index)

Removes a class break at the specified index in the list model.

void ClassBreakListModel::removeOne(ClassBreak *classBreak)

Removes the specified classBreak from the list model.

int ClassBreakListModel::size() const

Returns the number of class breaks in the model.


Feedback on this topic?