Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-3_36] QgsProject: The flag to read extent from xml was set too late #57297

Merged
merged 2 commits into from
May 13, 2024

Commits on Apr 30, 2024

  1. QgsProject: The flag to read extent from xml was set too late

    The `QgsProject::addLayer` method which add a layer from DOM layer element uses the method `projectFlagsToLayerReadFlags` to get layer read flags from project flags.
    The generated layer read flags is used into the `QgsMapLayer::readLayerFromXml` method. This method read the extent from XML only if the `QgsMapLayer::FlagReadExtentFromXml`
    flag is set. If it is not set, the layer extent (provided by the provider) and layer extent from xml are empty. So even if the read extent from xml is set to true for vector
    layer, the extent will be always provided by the provider if the flag `QgsMapLayer::FlagReadExtentFromXml` is not provided to `QgsMapLayer::readLayerFromXml` method.
    
    To fix it, we proposed to update `QgsProject::projectFlagsToLayerReadFlags` method to provide `QgsMapLayer::FlagReadExtentFromXml` from project flags.
    
    Funded by Tenergie
    rldhont authored and github-actions[bot] committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    0d1ed48 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e60e011 View commit details
    Browse the repository at this point in the history