A list model storing a list of class breaks available in a class breaks renderer. More...
Header: | #include <ClassBreakListModel.h> |
Since: | Esri::ArcGISRuntime 100.0 |
Inherits: | QAbstractListModel and Esri::ArcGISRuntime::Iterable |
Public Types
enum | ClassBreakRoles { ClassBreakDescriptionRole, ClassBreakLabelRole, ClassBreakMaxValueRole, ClassBreakMinValueRole } |
Public Functions
virtual | ~ClassBreakListModel() override |
void | append(Esri::ArcGISRuntime::ClassBreak *classBreak) |
void | clear() |
bool | contains(Esri::ArcGISRuntime::ClassBreak *classBreak) const |
Esri::ArcGISRuntime::ClassBreak * | first() const |
int | indexOf(Esri::ArcGISRuntime::ClassBreak *classBreak) const |
void | insert(int index, Esri::ArcGISRuntime::ClassBreak *classBreak) |
bool | isEmpty() const |
Esri::ArcGISRuntime::ClassBreak * | last() const |
void | move(int from, int to) |
void | removeAt(int index) |
void | removeOne(Esri::ArcGISRuntime::ClassBreak *classBreak) |
Reimplemented Public Functions
virtual Esri::ArcGISRuntime::ClassBreak * | at(int index) const override |
virtual QVariant | data(const QModelIndex &index, int role = Qt::DisplayRole) const override |
virtual int | size() const override |
Signals
void | errorOccurred(const Esri::ArcGISRuntime::Error &error) |
void | itemAdded(int index) |
void | itemRemoved(int index) |
Detailed Description
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:
Role | Type | Description | ClassBreakRoles |
---|---|---|---|
description | QString | The description of the class break. | ClassBreakDescriptionRole |
label | QString | The label used to display the class break. | ClassBreakLabelRole |
maxValue | double | The maximum value of the class break. | ClassBreakMaxValueRole |
minValue | double | The 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.
Constant | Value | Description |
---|---|---|
Esri::ArcGISRuntime::ClassBreakListModel::ClassBreakDescriptionRole | Qt::UserRole + 1 | The description of the class break. |
Esri::ArcGISRuntime::ClassBreakListModel::ClassBreakLabelRole | Qt::UserRole + 2 | The label used to display the class break. |
Esri::ArcGISRuntime::ClassBreakListModel::ClassBreakMaxValueRole | Qt::UserRole + 3 | The maximum value of the class break. |
Esri::ArcGISRuntime::ClassBreakListModel::ClassBreakMinValueRole | Qt::UserRole + 4 | The minimum value of the class break. |
Member Function Documentation
[override virtual]
ClassBreakListModel::~ClassBreakListModel ()
Destructor.
void ClassBreakListModel::append(Esri::ArcGISRuntime::ClassBreak *classBreak )
Appends the classBreak to the class break list model.
[override virtual]
Esri::ArcGISRuntime::ClassBreak *ClassBreakListModel::at(int index) const
Returns the class break at the specified index.
void ClassBreakListModel::clear()
Removes all class breaks from the list model.
List models do not take ownership of the objects they contain. Therefore, removing or clearing objects from the list model will not delete those objects. An RAII technique should be used to ensure that memory is properly deallocated.
bool ClassBreakListModel::contains(Esri::ArcGISRuntime::ClassBreak *classBreak ) const
Returns true
if the provided classBreak is in the list model.
[override virtual]
QVariant ClassBreakListModel::data(const QModelIndex &index, int role = Qt::DisplayRole) const
Reimplements: QAbstractItemModel::data(const QModelIndex &index, int role) const.
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 (const Esri::ArcGISRuntime::Error &error)
Signal emitted when an error occurs.
- error - Details about the error.
Esri::ArcGISRuntime::ClassBreak *ClassBreakListModel::first() const
Returns the first class break in the list model.
int ClassBreakListModel::indexOf (Esri::ArcGISRuntime::ClassBreak *classBreak ) const
Returns the index of the provided classBreak in the list model.
void ClassBreakListModel::insert(int index, Esri::ArcGISRuntime::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.
[signal, since Esri::ArcGISRuntime 100.15]
void ClassBreakListModel::itemAdded (int index)
Signal emitted when an item is added to the model.
index is the index of the added item.
This function was introduced in Esri::ArcGISRuntime 100.15.
[signal, since Esri::ArcGISRuntime 100.15]
void ClassBreakListModel::itemRemoved (int index)
Signal emitted when an item is removed from the model.
index is the index of the removed item.
This function was introduced in Esri::ArcGISRuntime 100.15.
Esri::ArcGISRuntime::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.
List models do not take ownership of the objects they contain. Therefore, removing or clearing objects from the list model will not delete those objects. An RAII technique should be used to ensure that memory is properly deallocated.
void ClassBreakListModel::removeOne (Esri::ArcGISRuntime::ClassBreak *classBreak )
Removes the specified classBreak from the list model.
List models do not take ownership of the objects they contain. Therefore, removing or clearing objects from the list model will not delete those objects. An RAII technique should be used to ensure that memory is properly deallocated.
[override virtual]
int ClassBreakListModel::size() const
Returns the number of class breaks in the model.