ClassBreakListModel Class

  • ClassBreakListModel
  • class Esri::ArcGISRuntime::ClassBreakListModel

    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

    This class was introduced in Esri::ArcGISRuntime 100.0.

    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 classBreakRemoved(int index)
    void errorOccurred(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:

    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

    [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.

    [signal] void ClassBreakListModel::errorOccurred(Esri::ArcGISRuntime::Error error)

    Signal emitted when an error occurs.

    • error - Details about the error.

    [signal] 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] 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.

    [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.

    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.

    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.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.