Skip To Content ArcGIS for Developers Sign In Dashboard

GraphicsOverlayListModel Class

(Esri::ArcGISRuntime::GraphicsOverlayListModel)

A container class storing a list of graphics overlays available in a GeoView. More...

Header: #include <GraphicsOverlayListModel>
Since: Esri::ArcGISRuntime 100.0
Inherits: QAbstractListModel and Iterable<GraphicsOverlay *>

Public Types

enum GraphicsOverlayRoles { GraphicsOverlayMinScaleRole, GraphicsOverlayMaxScaleRole, GraphicsOverlayOpacityRole, GraphicsOverlayVisibleRole, GraphicsOverlaySelectionColorRole, GraphicsOverlayIdRole }

Public Functions

~GraphicsOverlayListModel()
void append(GraphicsOverlay *graphicsOverlay)
GraphicsOverlay *at(int index) const
void clear()
bool contains(GraphicsOverlay *graphicsOverlay) const
GraphicsOverlay *first() const
int indexOf(GraphicsOverlay *graphicsOverlay) const
void insert(int index, GraphicsOverlay *graphicsOverlay)
bool isEmpty() const
GraphicsOverlay *last() const
void move(int from, int to)
void removeAt(int index)
void removeOne(GraphicsOverlay *graphicsOverlay)
int size() const

Reimplemented Public Functions

virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const

Signals

void graphicsOverlayAdded(int index)
void graphicsOverlayRemoved(int index)

Additional Inherited Members

Detailed Description

A container class storing a list of graphics overlays available in a GeoView.

Modifying this collection (adding, removing, moving) will update the graphics overlays available in the GeoView.

The model returns data for the following roles:

RoleTypeDescriptionGraphicsOverlayRoles
minScaledoubleThe minimum scale at which the graphics should be displayed.GraphicsOverlayMinScaleRole
maxScaledoubleThe maximum scale at which the graphics should be displayed.GraphicsOverlayMaxScaleRole
graphicsOverlayOpacityfloatThe opacity of the graphics.GraphicsOverlayOpacityRole
graphicsOverlayVisibleboolWhether the graphics overlay is visible.GraphicsOverlayVisibleRole
selectionColorQColorThe selection color applied to selected graphics.GraphicsOverlaySelectionColorRole
idQStringThe 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.

ConstantValueDescription
Esri::ArcGISRuntime::GraphicsOverlayListModel::GraphicsOverlayMinScaleRoleQt::UserRole + 1The minimum scale at which the graphics should be displayed.
Esri::ArcGISRuntime::GraphicsOverlayListModel::GraphicsOverlayMaxScaleRoleQt::UserRole + 2The maximum scale at which the graphics should be displayed.
Esri::ArcGISRuntime::GraphicsOverlayListModel::GraphicsOverlayOpacityRoleQt::UserRole + 3The opacity of the graphics.
Esri::ArcGISRuntime::GraphicsOverlayListModel::GraphicsOverlayVisibleRoleQt::UserRole + 4Whether the graphics overlay is visible.
Esri::ArcGISRuntime::GraphicsOverlayListModel::GraphicsOverlaySelectionColorRoleQt::UserRole + 5The selection color applied to selected graphics.
Esri::ArcGISRuntime::GraphicsOverlayListModel::GraphicsOverlayIdRoleQt::UserRole + 6The ID of the selected graphics.

Member Function Documentation

GraphicsOverlayListModel::~GraphicsOverlayListModel()

Destructor.

void GraphicsOverlayListModel::append(GraphicsOverlay *graphicsOverlay)

Appends the graphicsOverlay to the graphics overlay list model.

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.

bool GraphicsOverlayListModel::contains(GraphicsOverlay *graphicsOverlay) const

Returns true if the provided graphicsOverlay is in the list model.

[virtual] QVariant GraphicsOverlayListModel::data(const QModelIndex &index, int role = Qt::DisplayRole) const

Reimplemented from QAbstractItemModel::data().

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.

GraphicsOverlay *GraphicsOverlayListModel::first() const

Returns the first graphics overlay in the list model.

[signal] void GraphicsOverlayListModel::graphicsOverlayAdded(int index)

Signal emitted when a GraphicsOverlay is added to the list.

index is the index of the added GraphicsOverlay.

[signal] void GraphicsOverlayListModel::graphicsOverlayRemoved(int index)

Signal emitted when a GraphicsOverlay is removed from the list.

index is the index of the removed GraphicsOverlay.

int GraphicsOverlayListModel::indexOf(GraphicsOverlay *graphicsOverlay) const

Returns the index of the provided graphicsOverlay in the list model.

void GraphicsOverlayListModel::insert(int index, 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.

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.

void GraphicsOverlayListModel::removeOne(GraphicsOverlay *graphicsOverlay)

Removes the specified graphicsOverlay from the list model.

int GraphicsOverlayListModel::size() const

Returns the number of graphics overlays in the model.


Feedback on this topic?