Bug report #18574

Layer name automatic capitalisation for toc does not work

Added by Harrissou Santanna almost 6 years ago.

Status:Open
Priority:Normal
Assignee:-
Category:Map Legend
Affected QGIS version:3.1(master) Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:26462

Description

See #17741 for some context
Check in Settings --> Options --> Advanced --> qgis that formatLayerName is set to false. If not, set it to false, validate and relaunch QGIS (don't know if reload is needed but...)

Now add layers to GUI: the name shown in the Layers Panel is the same as their filename.
Open a layer properties, Source and edit the layer name: the displayed text box is shown titled, ie "new_layer" becomes "New Layer". (first bug?)
Apply and actually, the displayed name in Layers panel will be what you really entered in the dialog and not what was shown in the "displayed" textbox. Which is conform to the global setting (formatLayerName = false).

Now set the formatLayerName option to true and reload QGIS
Add layers: their name are automatically titled
Open layer properties and rename it in lower case: "new_layer" is displayed in the dialog as "New Layer" (which is correct)
Apply and the displayed name in Layers panel will be what you really entered in the dialog and not what was shown in the "displayed" textbox. Which in this case is NOT conform to the global setting (formatLayerName = true).

To summarize:

  • "displayed as" textbox in layer properties dialog always shows the layer name in title case
  • what is entered in the "layer name" textbox is what is actually shown in the Layers panel, regardless the settings.

On a side note, while forced capitalization is not conform to all users needs, I think that making it available only in the Advanced settings is like hiding it and i'm not sure most of the people that might need it will find it (you need to read the code for that). Imho, the GUI setting should come back.

Tested on f75c0a80e6

Also available in: Atom PDF