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

Use QgsProject to load needed informations for menu creation #87

Merged
merged 6 commits into from
Sep 20, 2024

Conversation

jmkerloch
Copy link
Contributor

This PR refactor needed project information load to use QgsProject object instead of parsing XML content.

Instead of parsing XML and create menu during parsing, the operation is done in 2 steps:

  • read needed information from QgsProject and store it in a specific dataclass (MenuProjectConfig)
  • use this dataclass to create menu for layer load

Note : we can't only use information inside QgsProject because there is an issue with QGIS when reading project with some flags (see qgis/QGIS#58818)

…reation:

- use a loaded QgsProject to get information about available layers and group
- store information about layer in dataclasses
- need to use xml document from QGIS project
- layer notes are not read in QgsMapLayer if read project flag is QgsProject.FlagDontResolveLayers
@xcaeag
Copy link
Owner

xcaeag commented Sep 20, 2024

vu la PR
l'affichage des notes n'a encore jamais été utilisé. Pour simplifier encore le code, on pourrait imaginer limiter cette fonctionnalité aux couches vectorielles (?).

@xcaeag xcaeag merged commit 359d495 into xcaeag:master Sep 20, 2024
1 check passed
@jmkerloch
Copy link
Contributor Author

Merci pour le merge rapide !

Pour la limitation aux vecteurs ce serait à discuter si jamais l'utilisation du doc xml est vraiment trop long.

Je n'ai pas eu de problème majeur avec l'utilisation de ce projet par exemple : https://raw.githubusercontent.com/Geoplateforme/plugin_idg_gpf/master/projet_idg_gpf.qgz

@xcaeag
Copy link
Owner

xcaeag commented Sep 20, 2024

les tests semaine prochaine... merci !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants