19 #ifndef QGSMAPLAYERSTORE_H
20 #define QGSMAPLAYERSTORE_H
22 #include "qgis_core.h"
57 int validCount()
const;
66 sipRes = sipCpp->count();
92 QList<QgsMapLayer *> mapLayersByName(
const QString &name )
const;
100 QMap<QString, QgsMapLayer *> mapLayers()
const;
109 QMap<QString, QgsMapLayer *> validMapLayers()
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.
void layersWillBeRemoved(const QStringList &layerIds)
Emitted when one or more layers are about to be removed from the store.
void layerWillBeRemoved(const QString &layerId)
Emitted when a layer is about to be removed from the store.
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...
QVector< T > layers() const
Returns a list of registered map layers with a specified layer type.
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.
void layersAdded(const QList< QgsMapLayer * > &layers)
Emitted when one or more layers were added to the store.
Base class for all map layer types.