25 QList<QgsMapLayer *> layersList;
29 const QMap<QString, QgsMapLayer *> mapLayers( project->
mapLayers() );
46 const QMap<QString, QgsMapLayer *> mapLayers( project->
mapLayers() );
62 if ( groupLayer->childLayers().contains( layer ) )
A map layer which consists of a set of child layers, where all component layers are rendered as a sin...
static bool updateLayerSourcePath(QgsMapLayer *layer, const QString &newPath)
Updates a layer's data source, replacing its data source with a path referring to newPath.
static bool layerSourceMatchesPath(const QgsMapLayer *layer, const QString &path)
Returns true if the source of the specified layer matches the given path.
Base class for all map layer types.
static bool updateLayerPath(QgsProject *project, const QString &oldPath, const QString &newPath)
Updates a project, replacing the data source for all layers which match the given oldPath with source...
static bool layerIsContainedInGroupLayer(QgsProject *project, QgsMapLayer *layer)
Returns true if the specified layer is a child layer from any QgsGroupLayer in the given project.
static QList< QgsMapLayer * > layersMatchingPath(const QgsProject *project, const QString &path)
Returns a list of all layers in the specified project which match the given path.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
QVector< T > layers() const
Returns a list of registered map layers with a specified layer type.
QMap< QString, QgsMapLayer * > mapLayers(const bool validOnly=false) const
Returns a map of all registered layers by layer ID.