SymbolListModel Class

  • SymbolListModel
  • class Esri::ArcGISRuntime::SymbolListModel

    A list model storing a list of symbols. More...

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

    This class was introduced in Esri::ArcGISRuntime 100.0.

    Public Types

    enum SymbolRoles { SymbolUrlRole }

    Public Functions

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

    Reimplemented Public Functions

    virtual Esri::ArcGISRuntime::Symbol *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(Esri::ArcGISRuntime::Error error)
    void itemAdded(int index)
    void itemRemoved(int index)

    Detailed Description

    Modifying this model (adding, removing, moving) will update the symbols belonging to the model's parent type (i.e. CompositeSymbol).

    The model returns data for the following roles:

    RoleTypeDescriptionSublayerRoles
    symbolUrlQUrlA file URL to the symbol's swatch image.SymbolUrlRole

    Member Type Documentation

    enum SymbolListModel::SymbolRoles

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

    ConstantValueDescription
    Esri::ArcGISRuntime::SymbolListModel::SymbolUrlRoleQt::UserRole + 1A file URL to the symbol's swatch image.

    Member Function Documentation

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

    Signal emitted when an error occurs.

    • error - Details about the error.

    [signal] void SymbolListModel::itemAdded(int index)

    Signal emitted when an item is added to the list model.

    index is the index of the added item.

    This function was introduced in Esri::ArcGISRuntime 100.15.

    [signal] void SymbolListModel::itemRemoved(int index)

    Signal emitted when an item is removed from the list model.

    index is the index of the removed item.

    This function was introduced in Esri::ArcGISRuntime 100.15.

    [override virtual] SymbolListModel::~SymbolListModel()

    Destructor.

    void SymbolListModel::append(Esri::ArcGISRuntime::Symbol *symbol)

    Appends a symbol to the symbol list model.

    [override virtual] Esri::ArcGISRuntime::Symbol *SymbolListModel::at(int index) const

    Returns the Symbol at the specified index.

    void SymbolListModel::clear()

    Removes all symbols 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 SymbolListModel::contains(Esri::ArcGISRuntime::Symbol *symbol) const

    Returns true if the list model contains the specified symbol.

    [override virtual] QVariant SymbolListModel::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 symbol 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::Symbol *SymbolListModel::first() const

    Returns the first symbol in the list model.

    int SymbolListModel::indexOf(Esri::ArcGISRuntime::Symbol *symbol) const

    Returns the index of the symbol specified.

    void SymbolListModel::insert(int index, Esri::ArcGISRuntime::Symbol *symbol)

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

    This method will append to the list if the index is greater than the current size of the list model.

    bool SymbolListModel::isEmpty() const

    Returns true if the list model contains no symbols.

    Esri::ArcGISRuntime::Symbol *SymbolListModel::last() const

    Returns the last symbol in the list model.

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

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

    void SymbolListModel::removeAt(int index)

    Removes a symbol at the specified index.

    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 SymbolListModel::removeOne(Esri::ArcGISRuntime::Symbol *symbol)

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

    Returns the number of symbols contained in the list model.

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