FeatureTableListModel Class

  • FeatureTableListModel
  • class Esri::ArcGISRuntime::FeatureTableListModel

    A list model that stores a list of feature tables. More...

    Header: #include <FeatureTableListModel.h>
    Since: Esri::ArcGISRuntime 100.1
    Inherits: QAbstractListModel and Esri::ArcGISRuntime::Iterable

    Public Types

    enum FeatureTableRoles { NameRole, GeometryTypeRole, HasGeometryRole, EditableRole, NumberOfFeaturesRole, LoadStatusRole }

    Public Functions

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

    Reimplemented Public Functions

    virtual Esri::ArcGISRuntime::FeatureTable *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 feature tables available in the Map.

    The model returns data for the following roles:

    RoleTypeDescriptionFeatureTableRoles
    namestringThe table's name.NameRole
    geometryTypeGeometryTypeThe tables's geometry type.GeometryTypeRole
    hasGeometryboolWhether the table contains features with geometry.HasGeometryRole
    editableboolWhether the table is editable.EditableRole
    numberOfFeaturesqint64The number of features within the table.NumberOfFeaturesRole
    loadStatusLoadStatusThe table's load status.LoadStatusRole

    Member Type Documentation

    enum FeatureTableListModel::FeatureTableRoles

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

    ConstantValueDescription
    Esri::ArcGISRuntime::FeatureTableListModel::NameRoleQt::UserRole + 1The table's name.
    Esri::ArcGISRuntime::FeatureTableListModel::GeometryTypeRoleQt::UserRole + 2The tables's geometry type.
    Esri::ArcGISRuntime::FeatureTableListModel::HasGeometryRoleQt::UserRole + 3Whether the table contains features with geometry.
    Esri::ArcGISRuntime::FeatureTableListModel::EditableRoleQt::UserRole + 4Whether the table is editable.
    Esri::ArcGISRuntime::FeatureTableListModel::NumberOfFeaturesRoleQt::UserRole + 5The number of features within the table.
    Esri::ArcGISRuntime::FeatureTableListModel::LoadStatusRoleQt::UserRole + 7The table's load status.

    Member Function Documentation

    [override virtual] FeatureTableListModel::~FeatureTableListModel()

    Destructor.

    void FeatureTableListModel::append(Esri::ArcGISRuntime::FeatureTable *featureTable)

    Appends a feature table (featureTable) to the feature table list model.

    [override virtual] Esri::ArcGISRuntime::FeatureTable *FeatureTableListModel::at(int index) const

    Returns the feature table at the specified index.

    void FeatureTableListModel::clear()

    Removes all feature tables 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 FeatureTableListModel::contains(Esri::ArcGISRuntime::FeatureTable *featureTable) const

    Returns true if the list model contains the specific feature table featureTable.

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

    Signal emitted when an error occurs.

    • error - Details about the error.

    Esri::ArcGISRuntime::FeatureTable *FeatureTableListModel::first() const

    Returns the first feature table in the list model.

    int FeatureTableListModel::indexOf(Esri::ArcGISRuntime::FeatureTable *featureTable) const

    Returns the index of the specific feature table featureTable.

    void FeatureTableListModel::insert(int index, Esri::ArcGISRuntime::FeatureTable *featureTable)

    Inserts a feature table (featureTable) 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 FeatureTableListModel::isEmpty() const

    Returns true if the list model contains no feature tables.

    [signal, since Esri::ArcGISRuntime 100.15] void FeatureTableListModel::itemAdded(int index)

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

    • index - The index of the added item.

    This function was introduced in Esri::ArcGISRuntime 100.15.

    [signal, since Esri::ArcGISRuntime 100.15] void FeatureTableListModel::itemRemoved(int index)

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

    • index - The index of the removed item.

    This function was introduced in Esri::ArcGISRuntime 100.15.

    Esri::ArcGISRuntime::FeatureTable *FeatureTableListModel::last() const

    Returns the last feature table in the list model.

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

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

    void FeatureTableListModel::removeAt(int index)

    Removes a feature table 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 FeatureTableListModel::removeOne(Esri::ArcGISRuntime::FeatureTable *featureTable)

    Removes a specific feature table (featureTable) 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 FeatureTableListModel::size() const

    Returns the number of feature tables 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.