Add control over layout scale bar unit position - #67392
nyalldawson wants to merge 4 commits into
Conversation
|
@nyalldawson A documentation ticket will be opened at https://github.com/qgis/QGIS-Documentation when this PR is merged. Please update the description (not the comments) with helpful description and screenshot to help the work from documentors. Thank you! |
|
This pull request has been tagged for the changelog.
You can edit the description. Format available for credits
Thank you! |
🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. 🍎 MacOS Qt6 buildsDownload MacOS Qt6 builds of this PR for testing. |
2d2a875 to
04d5fac
Compare
Tests failed for Qt 6 (ALL_BUT_PROVIDERS - ubuntu)One or more tests failed using the build from commit 04d5fac importComposerTemplateScaleBar_0 (importComposerTemplateScaleBar)importComposerTemplateScaleBar_0Test failed at importComposerTemplateScaleBar at tests/src/core/testqgscompositionconverter.cpp:487 Rendered image did not match tests/testdata/control_images/compositionconverter/expected_importComposerTemplateScaleBar_0/expected_importComposerTemplateScaleBar_0.png (found 215 pixels different) importComposerTemplate_0 (importComposerTemplate)importComposerTemplate_0Test failed at importComposerTemplate at tests/src/core/testqgscompositionconverter.cpp:643 Rendered image did not match tests/testdata/control_images/compositionconverter/expected_importComposerTemplate_0/expected_importComposerTemplate_0.png (found 215 pixels different) The full test report (included comparison of rendered vs expected images) can be found here. Further documentation on the QGIS test infrastructure can be found in the Developer's Guide. |
Tests failed for Qt 6 (ALL_BUT_PROVIDERS - fedora)One or more tests failed using the build from commit 04d5fac importComposerTemplateScaleBar_0 (importComposerTemplateScaleBar)importComposerTemplateScaleBar_0Test failed at importComposerTemplateScaleBar at tests/src/core/testqgscompositionconverter.cpp:487 Rendered image did not match tests/testdata/control_images/compositionconverter/expected_importComposerTemplateScaleBar_0/expected_importComposerTemplateScaleBar_0.png (found 215 pixels different) importComposerTemplate_0 (importComposerTemplate)importComposerTemplate_0Test failed at importComposerTemplate at tests/src/core/testqgscompositionconverter.cpp:643 Rendered image did not match tests/testdata/control_images/compositionconverter/expected_importComposerTemplate_0/expected_importComposerTemplate_0.png (found 215 pixels different) The full test report (included comparison of rendered vs expected images) can be found here. Further documentation on the QGIS test infrastructure can be found in the Developer's Guide. |
Instead of forcing the units to always be placed after the last distance label, users now have a choice of exactly where they want them placed. Options are: Vertically centered on the bar, before the bar begins Vertically centered on the bar, after the bar ends Text centered over the left edge of the bar, above the bar Horizontally centered on the bar, above the bar Text centered over the right edge of the bar, above the bar Text centered over the left edge of the bar, below the bar Horizontally centered on the bar, below the bar Text centered over the right edge of the bar, below the bar Placed before the first distance label Placed after the last distance label Placed on top of the bar, after the first bar division Placed before every distance label (as part of the distance label text) Placed after every distance label (as part of the distance label text) Multiple options may be selected, allowing for fully flexible unit label positioning. Sponsored by the QGIS Swiss User Group
04d5fac to
17d8809
Compare
| { | ||
| // fallback to older attribute, appending the space which was previously always | ||
| // added by the scalebar renderer | ||
| mSettings.setUnitLabel( itemElem.attribute( u"unitLabel"_s ) + ' ' ); |
There was a problem hiding this comment.
shouldn't the space be preprended?
Description
Instead of forcing the units to always be placed after the last distance label, users now have a choice of exactly where they want them placed.
Options are:
Multiple options may be selected, allowing for fully flexible unit label positioning.
Sponsored by the QGIS Swiss User Group
AI tool usage