QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
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;
369 #endif //QGSMAPLAYERSTORE_H
void allLayersRemoved()
Emitted when all layers are removed, before layersWillBeRemoved() and layerWillBeRemoved() signals ar...
void layersAdded(const QList< QgsMapLayer * > &layers)
Emitted when one or more layers were added to the store.
void layersRemoved(const QStringList &layerIds)
Emitted after one or more layers were removed from the store.
void layerWasAdded(QgsMapLayer *layer)
Emitted when a layer was added to the store.
A storage object for map layers, in which the layers are owned by the store and have their lifetime b...
QVector< T > layers() const
Returns a list of registered map layers with a specified layer type.
void layersWillBeRemoved(const QStringList &layerIds)
Emitted when one or more layers are about to be removed from the store.
void layerWillBeRemoved(QgsMapLayer *layer)
Emitted when a layer is about to be removed from the store.
void layerRemoved(const QString &layerId)
Emitted after a layer was removed from the store.
Base class for all map layer types.
void layersWillBeRemoved(const QList< QgsMapLayer * > &layers)
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.