99 Commits

Author SHA1 Message Date
Nyall Dawson
e0411e608d Refactor out scalebar code for calculating pretty interval sizes
into reusable function
2019-08-28 14:12:28 +10:00
Nyall Dawson
b90529b4c2 UI and API setup for dynamically calculated grid intervals 2019-08-28 14:12:28 +10:00
Nyall Dawson
e6a93e25c6 Add missing data defined properties 2019-08-28 14:12:28 +10:00
Nyall Dawson
0900831c8a Use map expression context as basis for map grid expression context
Allows use of map related variables like @map_scale, @map_extent_width,
etc in layout map grid data defined expressions
2019-08-28 14:12:28 +10:00
Nyall Dawson
658cb0c740 [FEATURE][layouts] Data defined control over grid properties
Adds data defined control over layout map grid:
- enabled state
- interval X/Y
- offset X/Y
- frame size and margin
- annotation distance from frame
- cross size
- frame line thickness

Fixes #30246, fixes #27737
2019-08-28 14:12:28 +10:00
Nyall Dawson
dbf9d917dd [FEATURE][layouts] Option to export multiple map themes while
creating GeoPDF documents from layouts
2019-08-21 05:15:04 +10:00
Nyall Dawson
3bb93fc00f Correctly georeference layout geopdf exports 2019-08-21 05:15:04 +10:00
Nyall Dawson
417f8d97a4 Hookup other pdf export settings to settings dialog 2019-08-21 05:15:04 +10:00
Nyall Dawson
b47dea0cc6 Spelling 2019-08-20 14:58:14 +10:00
Nyall Dawson
5a252a3b81 Expose map theme info to export layer details 2019-08-20 14:58:14 +10:00
Nyall Dawson
f49389d751 [layouts] API framework to allow rendering multiple map themes to layered exports 2019-08-20 14:58:14 +10:00
Nyall Dawson
1a294df22a Start on GeoPDF exporter class 2019-08-17 14:53:11 +10:00
Nyall Dawson
2074f2c9fc Warnings 2019-08-14 06:46:19 +10:00
Nyall Dawson
be4e7b1088 More attempt to fix doxygen warning 2019-08-14 06:46:19 +10:00
Nyall Dawson
b4a172f87e Dox fixes 2019-08-14 06:46:19 +10:00
Nyall Dawson
f0d60952bf Dox++ 2019-08-14 06:46:19 +10:00
Nyall Dawson
4f81a88812 [layouts] Add flags to control whether labels are split to multiple
layers in multi-layer exports
2019-08-14 06:46:19 +10:00
Nyall Dawson
de3b886313 Fix generation of layer names for exported multi-layer map exports 2019-08-14 06:46:19 +10:00
Nyall Dawson
56609123fc [layouts] Rework API for item export to multi-layered exports
Reworks the QgsLayoutItem API for handling multi-layered exports
to work as an iterator. The advantage with this is that it avoids
items needing to calculate in advance how many layers they require
in the output file.
2019-08-14 06:46:19 +10:00
Nyall Dawson
a46803844a [layouts] Add an indicator in the status bar while a map redraw is
occurring in the background

Otherwise there's no way to tell if a redraw is humming away in
the background, or is completed...
2019-08-13 18:27:38 +10:00
nirvn
f623c52fdf [needs-docs][layout] Give user explicit option to georeference (or not) PDF exports 2019-08-12 19:21:17 +07:00
Nyall Dawson
0f2a4828e4 Better display names for page items
These can't have ids set, so default to a nicer looking name
2019-08-12 16:12:03 +10:00
Nyall Dawson
276a34fd12 Add API to set/retrieve plural variants of layout item type names (e.g. Labels instead of Label) 2019-08-12 16:12:03 +10:00
Nyall Dawson
208beb7f8c [layouts] Improve logic of splitting layouts into separate layers when
exporting to a multi-layer format

Now, items are either
- placed onto the same layer as other items (simple items like labels, lines, pictures)
- placed onto the same layer as only other items of equal types (semi-complex items like scalebars or pages)
- placed onto their own unique layers (complex items like legends, maps)

Plus lots of tests covering this, where previously there was few
2019-08-12 16:12:03 +10:00
Nyall Dawson
b6ab6df69f Also allow retrieving map layer ID associated with a layout export layer 2019-08-12 16:12:03 +10:00
Nyall Dawson
3fe851a306 API Improvements to handling layered layout exports, add tests
Fixes #20253
2019-08-12 16:12:03 +10:00
Nyall Dawson
568aabb6dd Add method to determine whether a layout map has any grids or overviews enabled 2019-08-12 16:12:03 +10:00
Nyall Dawson
4636773bd6 Add API to register rendered feature handlers for a layout map 2019-08-12 16:12:03 +10:00
Nyall Dawson
d8d23b56ea [FEATURE][layouts] Add option to simplify PDF or SVG exports
This new setting, "Simplify geometries to reduce output file size",
is exposed in the SVG or PDF export settings dialogs shown when
exporting a layout/atlas/report to PDF or SVG.

If checked (the new default), geometries will be simplified while exporting
layouts in order to remove any redundant vertices which are not
discernably different at the export DPI. (e.g. if export DPI is 300 dpi,
vertices less then 1/600 inch different from each other will be removed).

This avoids exporting ALL geometry vertices during PDF/SVG export,
which can result in a ridiculously complex and large export file size.
Aside from the file size issues, it also causes problems when trying
to load these outputs into other applications, e.g. Inkscape, which
chokes on the huge number of vertices and grinds to a crawl.

Sponsored by the GeoPDF export group
2019-08-07 15:57:26 +10:00
Nyall Dawson
daf3491b5e [layouts] Add vector simplification method to QgsLayoutRendereContext
Allows specification of simplify method to use when rendering layouts
2019-08-07 15:57:26 +10:00
nirvn
8b5ba4a0cf Fix rebase gone wrong and address review 2019-07-29 15:14:34 +07:00
nirvn
3a37c83da7 [FEATURE][layout] Add horizontal placement option for scale bar labels 2019-07-29 15:14:34 +07:00
nirvn
e5deb5517b [FEATURE][layout] Add above/below segments placement option for scale bar labels 2019-07-29 15:14:34 +07:00
Nyall Dawson
87282e5dd7 [needs-docs] Add checkbox to layout map label settings panel to allow
display of unplaced labels

This is independant from the main canvas setting, and can be used
to determine whether labels are missing from a particular layout map
2019-07-21 20:29:34 +10:00
luz.paz
604e66ba75 sipify_all 2019-07-16 11:29:42 +10:00
Alex
248af94ba9 Symbol aware legend expression (#9648) 2019-07-15 07:12:24 +02:00
Nyall Dawson
590d1aae9d [FEATURE][API] Visitor API for style entities
Adds a new visitor pattern API for creation of visitors which visit
all the style entities (symbols, color ramps, text formats, and
label styles) associated with different objects. Can be used on a
renderer, map layer, or project wide level.

E.g. on a project wide level, allows collection of ALL the style
symbols/color ramps/text settings inside a project, including those
in layouts or annotations!
2019-07-06 12:36:54 +10:00
Nyall Dawson
03af890132 Address review comments 2019-06-28 09:45:48 +10:00
Nyall Dawson
6aeedfe20b [FEATURE][layouts] Expose choice of arrangement of legends (i.e.
symbols to the left OR symbols to the right of legend text), and
alignment for group/subgroup/item text

Allows creation of right-to-left locale friendly legends. Additionally,
we default to this right-to-left style alignment when creating new
legends under a RTL based locale.
2019-06-28 09:45:48 +10:00
Nyall Dawson
ef97fefbaa [layouts] Add API to set expression variables at a multiframe level 2019-06-28 07:12:40 +10:00
Nyall Dawson
bdbb622bac Fix crash when using QgsLayoutItemComboBox when null values
are displayed

Turns out there is NO reliable way to create a proxy model
which adds new rows to a model, so just bite the bullet and
do it in the underlying model (yuck)
2019-03-18 17:32:31 +10:00
Nyall Dawson
f9fb4085b2 Tweaks to layout item combo box 2019-03-12 08:16:52 +10:00
Nyall Dawson
cba22770dc Move layout manager model from app to core and add unit tests 2019-03-12 08:16:52 +10:00
Matteo Nastasi
7c6b66be8a [FEATURE] [needs-docs] add new vertical and horizontal equispaced distributions 2019-03-09 18:18:07 +01:00
Nyall Dawson
107b48a430 Add NULLPTR macro for use in doxygen comments
For the c++ api dox this expands to "\c nullptr" (the
\c directive indicates a code literal value), and for sipify/Python
it expands to ``None`` (`` is sphinx annotation for literal values)

Makes for nicer dox for both c++ and Python!
2019-02-27 09:41:11 +10:00
Nyall Dawson
a7ca08784c Nullptr consistency in dox 2019-02-27 09:41:11 +10:00
Nyall Dawson
b6d66becab Sipify 2019-02-27 09:41:11 +10:00
Nyall Dawson
519a30f10c Standardise dox for signals 2019-02-26 03:24:31 +10:00
Nyall Dawson
e670371fa3 [layouts] Show an explicit warning when exporting a layout which contains a broken image 2019-01-31 10:02:18 +11:00
Nyall Dawson
60b8d05278 [needs-docs][layouts] Add checkbox to disable raster tiling for PDF/SVG exports
This setting, which is disabled by default and placed into an
"advanced" group on PDF/SFG export, disables the built-in
raster layer tiled rendering. While the tiling is good for
memory usage, it can cause visible "seams" in the rasters
for generated PDF/SVG files.

The setting has a tooltip warning users that disabling the
tiling results in high memory usage during exports.

Fixes #19500
2019-01-30 05:09:29 +11:00