A list model storing a list of type KmlGeometry. More...
Header: | #include <KmlGeometryListModel.h> |
Since: | Esri::ArcGISRuntime 100.6 |
Inherits: | QAbstractListModel and Esri::ArcGISRuntime::Iterable |
Public Types
enum | KmlGeometryRoles { KmlGeometryGeometryRole, KmlGeometryTessellatedRole, KmlGeometryExtrudedRole, KmlGeometryKmlAltitudeModeRole, KmlGeometryKmlGeometryTypeRole, …, KmlGeometryObjectTypeRole } |
Public Functions
virtual | ~KmlGeometryListModel() override |
void | append(const Esri::ArcGISRuntime::KmlGeometry &geometry) |
void | clear() |
bool | contains(const Esri::ArcGISRuntime::KmlGeometry &geometry) const |
Esri::ArcGISRuntime::KmlGeometry | first() const |
int | indexOf(const Esri::ArcGISRuntime::KmlGeometry &geometry) const |
void | insert(int index, const Esri::ArcGISRuntime::KmlGeometry &geometry) |
bool | isEmpty() const |
Esri::ArcGISRuntime::KmlGeometry | last() const |
void | move(int from, int to) |
void | removeAt(int index) |
void | removeOne(const Esri::ArcGISRuntime::KmlGeometry &geometry) |
Reimplemented Public Functions
virtual Esri::ArcGISRuntime::KmlGeometry | 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
The model returns data for the following roles:
Role | Type | Description | KmlGeometryRoles |
---|---|---|---|
geometry | Geometry | The KmlGeometry's geometry. | KmlGeometryGeometryRole |
tessellated | bool | The KmlGeometry's tessellated flag. | KmlGeometryTessellatedRole |
extruded | bool | The KmlGeometry's extruded flag. | KmlGeometryExtrudedRole |
altitudeMode | KmlAltitudeMode | The KmlGeometry's altitude mode. | KmlGeometryKmlAltitudeModeRole |
kmlGeometryType | KmlGeometryType | The KmlGeometry's geometry type. | KmlGeometryKmlGeometryTypeRole |
geometryJson | QString | JSON representation of the KmlGeometry's geometry. | KmlGeometryGeometryJsonRole |
objectType | KmlGeometryObjectType | The KmlGeometry's object type. | KmlGeometryObjectTypeRole |
Member Type Documentation
enum KmlGeometryListModel::KmlGeometryRoles
This enum specifies the custom roles that can be used with KmlGeometryListModel::data.
Constant | Value | Description |
---|---|---|
Esri::ArcGISRuntime::KmlGeometryListModel::KmlGeometryGeometryRole | Qt::UserRole + 1 | The KmlGeometry's geometry. |
Esri::ArcGISRuntime::KmlGeometryListModel::KmlGeometryTessellatedRole | 258 | Flag indicating if the KmlGeometry is tessellated. |
Esri::ArcGISRuntime::KmlGeometryListModel::KmlGeometryExtrudedRole | 259 | Flag indicating if the KmlGeometry is extruded. |
Esri::ArcGISRuntime::KmlGeometryListModel::KmlGeometryKmlAltitudeModeRole | 260 | Enum indicating altitude mode of the KmlGeometry. |
Esri::ArcGISRuntime::KmlGeometryListModel::KmlGeometryKmlGeometryTypeRole | 261 | Enum indicating geometry type of the KmlGeometry. |
Esri::ArcGISRuntime::KmlGeometryListModel::KmlGeometryGeometryJsonRole | 262 | Enum indicating geometry json of the KmlGeometry's geometry. |
Esri::ArcGISRuntime::KmlGeometryListModel::KmlGeometryObjectTypeRole | 263 | Enum indicating the KmlGeometry object type. |
Member Function Documentation
[override virtual]
KmlGeometryListModel::~KmlGeometryListModel ()
Destructor.
void KmlGeometryListModel::append(const Esri::ArcGISRuntime::KmlGeometry &geometry)
Appends the KmlGeometry geometry to the list model.
[override virtual]
Esri::ArcGISRuntime::KmlGeometry KmlGeometryListModel::at(int index) const
Returns the KmlGeometry at the specified index.
void KmlGeometryListModel::clear()
Removes all KmlGeometry elements 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 KmlGeometryListModel::contains(const Esri::ArcGISRuntime::KmlGeometry &geometry) const
Returns true
if the list model contains the KmlGeometry geometry.
[override virtual]
QVariant KmlGeometryListModel::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 KmlGeometry referred to by the index.
- index. The index in the model for which to return data.
- role. The role for which to return data.
An empty value is returned if the specified index is out of range.
[signal]
void KmlGeometryListModel::errorOccurred (const Esri::ArcGISRuntime::Error &error)
Signal emitted when an error occurs.
- error - Details about the error.
Esri::ArcGISRuntime::KmlGeometry KmlGeometryListModel::first() const
Returns the first KmlGeometry in the list model.
int KmlGeometryListModel::indexOf (const Esri::ArcGISRuntime::KmlGeometry &geometry) const
Returns the index of the KmlGeometry geometry in the list model.
Returns -1
if geometry is not in the list model.
void KmlGeometryListModel::insert(int index, const Esri::ArcGISRuntime::KmlGeometry &geometry)
Inserts the KmlGeometry geometry into the list model at a specified index.
This method will append to the list if the index is greater than the current size of the list model.
bool KmlGeometryListModel::isEmpty () const
Returns true
if the list model contains no KmlGeometry elements.
[signal, since Esri::ArcGISRuntime 100.15]
void KmlGeometryListModel::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 KmlGeometryListModel::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::KmlGeometry KmlGeometryListModel::last() const
Returns the last KmlGeometry in the list model.
void KmlGeometryListModel::move(int from, int to)
Moves one KmlGeometry from an index in the list model to a different index.
Both indexes from and to must be at least 0 and less than size.
void KmlGeometryListModel::removeAt (int index)
Removes a KmlGeometry at the specified index.
No KmlGeometry will be removed if the specified index is out of range.
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 KmlGeometryListModel::removeOne (const Esri::ArcGISRuntime::KmlGeometry &geometry)
Removes the KmlGeometry geometry 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 KmlGeometryListModel::size() const
Returns the number of KmlGeometry elements contained in the list model.