-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
qgslayertreemodel: Ensure to refresh when elevation properties change
If an elevation profile widget is already open, when a new raster layer is added, it is not added to the elevation widget treeview. Indeed, when a new raster is added, `QgsRasterLayer::elevationProperties::hasElevation()` returns `False` by default and the proxy model of the elevation filters out the layers which do not have an elevation. Later on, `QgsAppLayerHandling::postProcessAddedLayer` is called on this raster and it sets the elevation to `True` if it looks like a DEM (See `QgsRasterLayerElevationProperties::layerLooksLikeDem()`). However, the layer tree of the elevation widget has already been populated and it is not updated. This issue is fixed by emitting the the `dataChanged` signal every time the elevation properties of a layer changes. Indeed, this forces a full refresh of the model and displays the raster in that case.
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 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
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