Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
postprocessing: Use QgsLayerTreeRegistryBridge to add layers
When a profile tool is already opened, the output of a procssing is not added to its layer tree. This is because it relies on a `QgsLayerTreeRegistryBridge`. Indeed, `QgsLayerTreeRegistryBridge` listens to the `QgsProject::legendLayersAdded()` signal in order to update the elevation profile tree view. However this signal is not triggered by the current logic in `Postprocessing.py`because `QgsProject::addMaplayer` is called with `addToLegend` set to False. Then, the layer is added to the tree by calling `QgsLayerTreeGroup::insertChildNode`. This issue is fixed by creating a `QgsLayerTreeRegistryBridge::InsertionPoint` to set the insertion point and then calling `QgsProject::addMaplayer` with `addToLegend` set to True.
- Loading branch information