19#ifndef QGSMAPLAYERSTORE_H
20#define QGSMAPLAYERSTORE_H
66 sipRes = sipCpp->count();
100 QMap<QString, QgsMapLayer *>
mapLayers()
const;
123 template <
typename T>
127 QMap<QString, QgsMapLayer *>::const_iterator layerIt = mMapLayers.constBegin();
128 for ( ; layerIt != mMapLayers.constEnd(); ++layerIt )
130 T tLayer = qobject_cast<T>( layerIt.value() );
163 QList<QgsMapLayer *> addMapLayers(
const QList<QgsMapLayer *> &layers
SIP_TRANSFER,
204 void removeMapLayers(
const QStringList &layerIds )
SIP_PYNAME( removeMapLayersById );
219 void removeMapLayers(
const QList<QgsMapLayer *> &layers );
233 void removeMapLayer(
const QString &
id );
265 void removeAllMapLayers();
361 void onMapLayerDeleted( QObject *obj );
365 QMap<QString, QgsMapLayer *> mMapLayers;
A storage object for map layers, in which the layers are owned by the store and have their lifetime b...
void layerWillBeRemoved(QgsMapLayer *layer)
Emitted when a layer is about to be removed from the store.
void layersWillBeRemoved(const QList< QgsMapLayer * > &layers)
Emitted when one or more layers are about to be removed from the store.
int count() const
Returns the number of layers contained in the store.
QMap< QString, QgsMapLayer * > mapLayers() const
Returns a map of all layers by layer ID.
QgsMapLayerStore(QObject *parent=nullptr)
Constructor for QgsMapLayerStore.
void layersWillBeRemoved(const QStringList &layerIds)
Emitted when one or more layers are about to be removed from the store.
int validCount() const
Returns the number of valid layers contained in the store.
void layerWillBeRemoved(const QString &layerId)
Emitted when a layer is about to be removed from the store.
QVector< T > layers() const
Returns a list of registered map layers with a specified layer type.
void layersRemoved(const QStringList &layerIds)
Emitted after one or more layers were removed from the store.
void allLayersRemoved()
Emitted when all layers are removed, before layersWillBeRemoved() and layerWillBeRemoved() signals ar...
void layerRemoved(const QString &layerId)
Emitted after a layer was removed from the store.
void layerWasAdded(QgsMapLayer *layer)
Emitted when a layer was added to the store.
QList< QgsMapLayer * > mapLayersByName(const QString &name) const
Retrieve a list of matching layers by layer name.
QMap< QString, QgsMapLayer * > validMapLayers() const
Returns a map of all valid layers by layer ID.
QgsMapLayer * mapLayer(const QString &id) const
Retrieve a pointer to a layer by layer id.
void layersAdded(const QList< QgsMapLayer * > &layers)
Emitted when one or more layers were added to the store.
Base class for all map layer types.