Skip to content

Layers added using a .qlr file cannot be added to an open Elevation Profile View #58533

Description

@PeterDrexel

What is the bug or the crash?

Using
"Log = QgsLayerDefinition().loadLayerDefinition("pathtofile/xxx.qlr", QgsProject.instance(),QgsProject.instance().layerTreeRoot())"
in a Script or in the Python-Console works well to open some elevation data into the layer table and the main view.
But if I want to see the same Data in an Elevation-Profile-View the dataset does not show up in an already opened Elevation-Profile-View. I have to close and reopen the Elevation Profile View to see the loaded Dataset.

Steps to reproduce the issue

Start QGIS

  • Load any Elevation Data and export a qlr-file for the Elevation-Dataset. Unload (Close) the Dataset again.
  • Load another Elevation Dataset
  • Open an Elevation-Profile-View (View - Elevation-Profile) and draw a Line - you can see the profile plot for the loaded dataset.
  • Keep the Elevation-Profile-View opened and Run "Log = QgsLayerDefinition().loadLayerDefinition("pathtofile/xxx.qlr", QgsProject.instance(),QgsProject.instance().layerTreeRoot())" in the python console - adjust the path to your saved .qlr-File). The Elevation-Dataset is loaded to the Layer-List und to the Main Map-View but not loaded to the Elevation-Profile-View and not to the Layer-List of the Elevation-Profile.

Versions

3.38.2

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

No response

Metadata

Metadata

Assignees

Labels

BugEither a bug report, or a bug fix. Let's hope for the latter!FeedbackWaiting on the submitter for answersProfile tool

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions