-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[BUGFIX] Regression in Composer legend, layer's title was not the default legend's title #7260
[BUGFIX] Regression in Composer legend, layer's title was not the default legend's title #7260
Conversation
Why would we use the title here? From the dox for QgsMapLayer::title(): "Returns the title of the layer used by QGIS Server in GetCapabilities request." That doesn't sound related to legend titles to me. |
@nyalldawson I probably have to update the dox. But in release-2_14 and before, the layer's title was used as the layer legend's title. |
But this change would also change behavior of non-server code, right? That could be regarded as a regression by QGIS app users... |
@wonder-sk Yes, this PR is not only for server it is also to fix a QGIS Desktop regression. |
I'm not too strong on server use, but too me this would be unexpected behaviour. The server metadata title and the name used in a legend may have no relation to each other, and it's standard qgis behaviour to take the layer's name for legends. I think this is quite an edge case which doesn't warrant changing the default behaviour for. |
The title was firstly designed for server, but it's a metadata and has been used as a title in legend. The name is for Desktop use, it can be the title or a simplify name to easily identify layers in the interface. This PR is a fix for a regression compare to the old LTR. This feature has been introduce in desktop by #824. |
This feature is in QGIS since 2.0 |
I guess ultimately I'm a 0 here because I'm not a server end user so don't have the required knowledge to comment. |
For my understanding, what's wrong with using I have no strong opinion (yet), just wondering
|
In #824 the logic seems more complicated than what I see here... it only applied to single symbol renderer, and it tried to use a text in these priorities: 1. symbol's custom text, 2. layer's custom text, 3. layer's title(), 4. layer's name() I guess I am also 0 on this... |
@m-kuhn the documentation about Actually QGIS 2.18 breaks project build with 2.14, because the legend rendering is not based on the same model. Some user does not update to 2.18 because of some regressions in Composer, that I am looking to fix like #7250 |
@wonder-sk the old legend model was more complex. |
But it's not just the documentation - it's how this setting is exposed within the qgis UI too. |
I'm still struggling to see the difference between title and name. What's the use-case where you need them to be different and - as a user - how do I know how this works? |
I agree with @rldhont : as a QGIS user, when I load layers in my project, from Shapefiles, Gpkg or PostgreSQL, I do not rename them in the layer panel (the "legend") because I like to see the real source name. For example I keep "main_roads" instead of renaming to "Main roads". In this context, I like to use the metadata "title" property as a replacement. Inside the composer, I would like to have the titles used, because my exported PDF is for my colleague and not me. And I do not want to rename all the item in my composer legend manually. |
That sounds like an edge case to me - the original layer source is already visible in the layer tooltips and from the layer properties window. My issue here is the misleading reuse of an unrelated setting - the title field is quite clearly marked as applying only to qgis server. |
…ault legend's title In release-2_14, the layer's title was the default legend's title. This capabilities has been lost with the use of the QgsLegendModelV2 in QgsLegendRenderer.
c41f2e2
to
f9bd907
Compare
Since QGIS 2.0, the layer's title is used as the default layer legend's name.
Ping @probot |
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
While we hate to see this happen, this PR has been automatically closed because it has not had any activity in the last 21 days. If this pull request should be reconsidered, please follow the guidelines in the previous comment and reopen this pull request. Or, if you have any further questions, just ask! We love to help, and if there's anything the QGIS project can do to help push this PR forward please let us know how we can assist. |
Description
In release-2_14, the layer's title was the default legend's title. This
capabilities has been lost with the use of the QgsLegendModelV2 in
QgsLegendRenderer.
Checklist
scripts/prepare-commit.sh
script before each commit