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

Remove invisible layers from legend #4531

Merged
merged 1 commit into from
Aug 5, 2017

Conversation

arnaud-morvan
Copy link
Contributor

@arnaud-morvan arnaud-morvan commented May 10, 2017

Description

Do not show invisible layers in composer legend.
Useful for raster layers as QgsMapHitTest only take care of vector layers.

Related with #14194 and #11641
May be backported to 2.18 before closing the tickets.

Checklist

Reviewing is a process done by project maintainers, mostly on a volunteer basis. We try to keep the overhead as small as possible and appreciate if you help us to do so by completing the following items. Feel free to ask in a comment if you have troubles with any of them.

  • Commit messages are descriptive and explain the rationale for changes
  • Commits which fix bugs include fixes #11111 in the commit message next to the description
  • Commits which add new features are tagged with [FEATURE] in the commit message
  • Commits which change the UI or existing user workflows are tagged with [needs-docs] in the commit message and containt sufficient information in the commit message to be documented
  • I have read the QGIS Coding Standards and this PR complies with them
  • This PR passes all existing unit tests (test results will be reported by travis-ci after opening this PR)
  • New unit tests have been added for core changes
  • I have run the scripts/prepare-commit.sh script before each commit

@3nids 3nids requested a review from wonder-sk May 10, 2017 14:56
@wonder-sk
Copy link
Member

Can we move the condition outside of the Q_FOREACH cycle? As far as I understand, the filterLegendNodes() method is called per each map layer separately, so we can leave early without looping through all nodes.

@m-kuhn
Copy link
Member

m-kuhn commented May 12, 2017

Concerning backporting: is this considered to be a bug?

@arnaud-morvan arnaud-morvan force-pushed the fix_filter_legend_nodes branch 2 times, most recently from d16fee1 to 0b97cfe Compare May 12, 2017 16:09
@arnaud-morvan
Copy link
Contributor Author

@wonder-sk : yes, this is only called with nodes from the same layer. I've move the test outside of the for loop.
@m-kuhn : This is a missing feature that can be considered a bug. Backporting make sense.

Do not show invisible layers in composer legend.
Useful for raster layers as QgsMapHitTest only take care of vector layers.
Related with qgis#14194
Related with qgis#11641
@arnaud-morvan
Copy link
Contributor Author

@wonder-sk : How about merging this ?

@wonder-sk wonder-sk merged commit a3bd321 into qgis:master Aug 5, 2017
@wonder-sk
Copy link
Member

Thanks @arnaud-morvan !

@arnaud-morvan arnaud-morvan deleted the fix_filter_legend_nodes branch August 5, 2017 12:56
@rldhont
Copy link
Contributor

rldhont commented Jun 15, 2018

@arnaud-morvan can you backport this fix to release-2_18 ?

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

Successfully merging this pull request may close these issues.

None yet

4 participants