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>
    Since: Esri::ArcGISRuntime 100.0
    Inherits: QAbstractListModel and Esri::ArcGISRuntime::Iterable

    This class was introduced in Esri::ArcGISRuntime 100.0.

    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


    void errorOccurred(Esri::ArcGISRuntime::Error error)
    void uniqueValueAdded(int index)
    void uniqueValueRemoved(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:

    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.

    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

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

    Signal emitted when an error occurs.

    • error - Details about the error.

    [signal] void UniqueValueListModel::uniqueValueAdded(int index)

    Signal emitted when a unique value is added to the model.

    index is the index of the added unique value.

    [signal] void UniqueValueListModel::uniqueValueRemoved(int index)

    Signal emitted when a unique value is removed from the model.

    index is the index of the removed unique value.

    [override virtual] UniqueValueListModel::~UniqueValueListModel()


    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.

    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.

    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.

    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.

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

    Removes the specified uniqueValue from the list model.

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