UniqueValueListModel Class

  • UniqueValueListModel
  • class Esri::ArcGISRuntime::UniqueValueListModel

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

    Header: #include <UniqueValueListModel.h>
    Since: Esri::ArcGISRuntime 100.0
    Inherits: QAbstractListModel and Esri::ArcGISRuntime::Iterable

    Public Types

    enum UniqueValueRoles { UniqueValueDescriptionRole, UniqueValueLabelRole, UniqueValueValuesRole }

    Public Functions

    virtual ~UniqueValueListModel() override
    void append(Esri::ArcGISRuntime::UniqueValue *uniqueValue)
    void clear()
    bool contains(Esri::ArcGISRuntime::UniqueValue *uniqueValue) const
    Esri::ArcGISRuntime::UniqueValue *first() const
    int indexOf(Esri::ArcGISRuntime::UniqueValue *uniqueValue) const
    void insert(int index, Esri::ArcGISRuntime::UniqueValue *uniqueValue)
    bool isEmpty() const
    Esri::ArcGISRuntime::UniqueValue *last() const
    void move(int from, int to)
    void removeAt(int index)
    void removeOne(Esri::ArcGISRuntime::UniqueValue *uniqueValue)

    Reimplemented Public Functions

    virtual Esri::ArcGISRuntime::UniqueValue *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 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

    [override virtual] UniqueValueListModel::~UniqueValueListModel()

    Destructor.

    void UniqueValueListModel::append(Esri::ArcGISRuntime::UniqueValue *uniqueValue)

    Appends the uniqueValue to the unique value list model.

    [override virtual] Esri::ArcGISRuntime::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.

    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 UniqueValueListModel::contains(Esri::ArcGISRuntime::UniqueValue *uniqueValue) const

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

    [override virtual] QVariant UniqueValueListModel::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 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(const Esri::ArcGISRuntime::Error &error)

    Signal emitted when an error occurs.

    • error - Details about the error.

    Esri::ArcGISRuntime::UniqueValue *UniqueValueListModel::first() const

    Returns the first unique value in the list model.

    int UniqueValueListModel::indexOf(Esri::ArcGISRuntime::UniqueValue *uniqueValue) const

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

    void UniqueValueListModel::insert(int index, Esri::ArcGISRuntime::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.

    [signal, since Esri::ArcGISRuntime 100.15] void UniqueValueListModel::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 UniqueValueListModel::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::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.

    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 UniqueValueListModel::removeOne(Esri::ArcGISRuntime::UniqueValue *uniqueValue)

    Removes the specified uniqueValue 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 UniqueValueListModel::size() const

    Returns the number of unique values 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.