A container class storing a list of graphics overlays available in a GeoView. More...
Header: | #include <GraphicsOverlayListModel.h> |
Since: | Esri::ArcGISRuntime 100.0 |
Inherits: | QAbstractListModel and Esri::ArcGISRuntime::Iterable |
Public Types
enum | GraphicsOverlayRoles { GraphicsOverlayMinScaleRole, GraphicsOverlayMaxScaleRole, GraphicsOverlayOpacityRole, GraphicsOverlayVisibleRole, GraphicsOverlayIdRole } |
Public Functions
virtual | ~GraphicsOverlayListModel() override |
void | append(Esri::ArcGISRuntime::GraphicsOverlay *graphicsOverlay) |
void | clear() |
bool | contains(Esri::ArcGISRuntime::GraphicsOverlay *graphicsOverlay) const |
Esri::ArcGISRuntime::GraphicsOverlay * | first() const |
int | indexOf(Esri::ArcGISRuntime::GraphicsOverlay *graphicsOverlay) const |
void | insert(int index, Esri::ArcGISRuntime::GraphicsOverlay *graphicsOverlay) |
bool | isEmpty() const |
Esri::ArcGISRuntime::GraphicsOverlay * | last() const |
void | move(int from, int to) |
void | removeAt(int index) |
void | removeOne(Esri::ArcGISRuntime::GraphicsOverlay *graphicsOverlay) |
Reimplemented Public Functions
virtual Esri::ArcGISRuntime::GraphicsOverlay * | at(int index) const override |
virtual QVariant | data(const QModelIndex &index, int role = Qt::DisplayRole) const override |
virtual int | size() const override |
Signals
void | itemAdded(int index) |
void | itemRemoved(int index) |
Detailed Description
Modifying this collection (adding, removing, moving) will update the graphics overlays available in the GeoView.
The model returns data for the following roles:
Role | Type | Description | GraphicsOverlayRoles |
---|---|---|---|
minScale | double | The minimum scale at which the graphics should be displayed. | GraphicsOverlayMinScaleRole |
maxScale | double | The maximum scale at which the graphics should be displayed. | GraphicsOverlayMaxScaleRole |
graphicsOverlayOpacity | float | The opacity of the graphics. | GraphicsOverlayOpacityRole |
graphicsOverlayVisible | bool | Whether the graphics overlay is visible. | GraphicsOverlayVisibleRole |
id | QString | The ID of the selected graphics. | GraphicsOverlayIdRole |
See also GraphicsOverlay.
Member Type Documentation
enum GraphicsOverlayListModel::GraphicsOverlayRoles
This enum specifies the custom roles which can be used with GraphicsOverlayListModel::data.
Constant | Value | Description |
---|---|---|
Esri::ArcGISRuntime::GraphicsOverlayListModel::GraphicsOverlayMinScaleRole | Qt::UserRole + 1 | The minimum scale at which the graphics should be displayed. |
Esri::ArcGISRuntime::GraphicsOverlayListModel::GraphicsOverlayMaxScaleRole | Qt::UserRole + 2 | The maximum scale at which the graphics should be displayed. |
Esri::ArcGISRuntime::GraphicsOverlayListModel::GraphicsOverlayOpacityRole | Qt::UserRole + 3 | The opacity of the graphics. |
Esri::ArcGISRuntime::GraphicsOverlayListModel::GraphicsOverlayVisibleRole | Qt::UserRole + 4 | Whether the graphics overlay is visible. |
Esri::ArcGISRuntime::GraphicsOverlayListModel::GraphicsOverlayIdRole | Qt::UserRole + 6 | The ID of the selected graphics. |
Member Function Documentation
[override virtual]
GraphicsOverlayListModel::~GraphicsOverlayListModel ()
Destructor.
void GraphicsOverlayListModel::append(Esri::ArcGISRuntime::GraphicsOverlay *graphicsOverlay )
Appends the graphicsOverlay to the graphics overlay list model.
[override virtual]
Esri::ArcGISRuntime::GraphicsOverlay *GraphicsOverlayListModel::at(int index) const
Returns the graphics overlay at the specified index.
void GraphicsOverlayListModel::clear()
Removes all graphics overlays 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 GraphicsOverlayListModel::contains(Esri::ArcGISRuntime::GraphicsOverlay *graphicsOverlay ) const
Returns true
if the provided graphicsOverlay is in the list model.
[override virtual]
QVariant GraphicsOverlayListModel::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 graphics overlay 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::GraphicsOverlay *GraphicsOverlayListModel::first() const
Returns the first graphics overlay in the list model.
int GraphicsOverlayListModel::indexOf (Esri::ArcGISRuntime::GraphicsOverlay *graphicsOverlay ) const
Returns the index of the provided graphicsOverlay in the list model.
void GraphicsOverlayListModel::insert(int index, Esri::ArcGISRuntime::GraphicsOverlay *graphicsOverlay )
Inserts a graphicsOverlay at a specified index in the list model.
bool GraphicsOverlayListModel::isEmpty () const
Returns true
if this list model is empty.
[signal, since Esri::ArcGISRuntime 100.15]
void GraphicsOverlayListModel::itemAdded (int index)
Signal emitted when an item is added to the list.
index is the index of the added item.
This function was introduced in Esri::ArcGISRuntime 100.15.
[signal, since Esri::ArcGISRuntime 100.15]
void GraphicsOverlayListModel::itemRemoved (int index)
Signal emitted when an item is removed from the list.
index is the index of the removed item.
This function was introduced in Esri::ArcGISRuntime 100.15.
Esri::ArcGISRuntime::GraphicsOverlay *GraphicsOverlayListModel::last() const
Returns the last graphics overlay in the list model.
void GraphicsOverlayListModel::move(int from, int to)
Moves one graphics overlay from an index in the list model to a different index.
void GraphicsOverlayListModel::removeAt (int index)
Removes a graphics overlay 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 GraphicsOverlayListModel::removeOne (Esri::ArcGISRuntime::GraphicsOverlay *graphicsOverlay )
Removes the specified graphicsOverlay 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 GraphicsOverlayListModel::size() const
Returns the number of graphics overlays in the model.