-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add API to QgsMapLayerRegistry to rely less on ids
- Loading branch information
Showing
3 changed files
with
126 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,6 +95,21 @@ class QgsMapLayerRegistry : QObject | |
*/ | ||
void removeMapLayers( const QStringList& theLayerIds ); | ||
|
||
/** | ||
* @brief | ||
* Remove a set of layers from the registry | ||
* | ||
* Any canvases using the affected layers will need to remove them | ||
* | ||
* The layers being removed are deleted as well as the registry | ||
* table entries. | ||
* | ||
* @param layers The layers to remove | ||
* | ||
* @note As a side-effect QgsProject is made dirty. | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
m-kuhn
Author
Member
|
||
*/ | ||
void removeMapLayers( const QList<QgsMapLayer*>& theLayerIds ); | ||
|
||
/** | ||
* @brief | ||
* Remove a layer from qgis | ||
|
@@ -110,6 +125,21 @@ class QgsMapLayerRegistry : QObject | |
*/ | ||
void removeMapLayer( const QString& theLayerId ); | ||
|
||
/** | ||
* @brief | ||
* Remove a layer from qgis | ||
* | ||
* Any canvases using the affected layers will need to remove them | ||
* | ||
* The layer being removed is deleted as well as the registry | ||
* table entry. | ||
* | ||
* @param layer The layer to remove | ||
* | ||
* @note As a side-effect QgsProject is made dirty. | ||
*/ | ||
void removeMapLayer( QgsMapLayer* layer ); | ||
|
||
/** | ||
* Remove all registered layers | ||
* | ||
|
@@ -141,14 +171,30 @@ class QgsMapLayerRegistry : QObject | |
void layersWillBeRemoved( const QStringList& theLayerIds ); | ||
|
||
/** | ||
* Emitted when a layer is removed from the registry | ||
* Emitted when one or more layers are removed from the registry | ||
* | ||
* @param theLayerIds A list layers which are removed. | ||
*/ | ||
void layersWillBeRemoved( const QList<QgsMapLayer*>& layer ); | ||
|
||
/** | ||
* Emitted when an owned layer is removed from the registry | ||
* | ||
* @param theLayerId The id of the layer being removed | ||
* | ||
* @note Consider using {@link layersWillBeRemoved()} instead | ||
*/ | ||
void layerWillBeRemoved( const QString& theLayerId ); | ||
|
||
/** | ||
* Emitted when an owned layer is removed from the registry | ||
* | ||
* @param layer The layer being removed | ||
* | ||
* @note Consider using {@link layersWillBeRemoved()} instead | ||
*/ | ||
void layerWillBeRemoved( QgsMapLayer* layer ); | ||
|
||
/** | ||
* Emitted after one or more layers were removed from the registry | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I'm afraid this will never be accessible from python unless you give it another name.