mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-15 00:02:52 -04:00
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.