4321 Commits

Author SHA1 Message Date
Nyall Dawson
a1128a52a4 Hide guides from layout exports 2017-12-18 16:45:10 +10:00
Nyall Dawson
0052eb830e Add unit test for pdf exports 2017-12-18 16:33:26 +10:00
Nyall Dawson
831732f3a3 Sipify 2017-12-17 14:18:36 +10:00
Nyall Dawson
65f4c4acef Port orientation decoding code from composer 2017-12-17 14:14:48 +10:00
Nyall Dawson
447a94909f Fix items moving after altering page size or inserting/deleting pages 2017-12-17 14:14:48 +10:00
Nyall Dawson
f649f1f8a7 [layouts][needs-docs] Add control for whether pages should be
exported, including data defined setting

This replaces the 2.x data-defined "number of pages" setting.
Instead of requiring users to develop an expression to return
the number of pages, instead we allow individual pages to have
a data defined control of whether that page should be included
in the export.

This is more flexible, and works correctly with the mixed page
size model for layouts.
2017-12-17 14:14:48 +10:00
Nyall Dawson
ca37a1ebd7 Fix drawing of map items (grids, overviews) when rendering map item as a raster item 2017-12-17 14:14:31 +10:00
Nyall Dawson
b992e871ee [layouts][FEATURE] Don't force the whole layout to be rasterized
when exporting to PDF

If an individual layout item needs rasterisation in order to
be exported correctly, it can now be individually rasterised
without forcing every other item to also be rasterised.

This allows exports to PDF keeping as much as possible as vectors,
e.g. a map with layer opacity won't force labels, scalebars, etc
to be rasterised too.

To accompany this, a new "Always export as vectors" checkbox
was added to layout properties. If checked, this will force
the export to keep items as vectors, even when it causes the
output to look different to layouts.

Fixes #7885
2017-12-17 14:14:31 +10:00
Nyall Dawson
91179f1396 Work on PDF export 2017-12-17 14:14:31 +10:00
Nyall Dawson
a59dce5048 Move containsAdvancedEffects test to QgsLayoutItem
And start a generic test library for all item types to ensure
correct behavior for QgsLayoutItem subclasses

Currently justs tests to ensure that overriden
containsAdvancedEffects methods also call the base class
test
2017-12-17 14:14:31 +10:00
Nyall Dawson
8b1e057d2c Make QgsLayoutExporter::generateFileName virtual, so exporter
subclasses can be made which customise the generated file names
2017-12-17 14:14:31 +10:00
Nyall Dawson
2f0969e2bd Expose antialiasing option in image export dialog
Allows for creating non-antialiased images from layouts. Note that
some layout item types do not correctly respect this setting, but
at least map items do and the API is in place for them to be
fixed later.

Fixes #9281
2017-12-17 14:14:31 +10:00
Nyall Dawson
1b8f4a09ba Add method to determine file path for exports which encountered errors 2017-12-17 14:14:31 +10:00
Nyall Dawson
5cf36cd819 Add method to detect whether layout has uniform page sizes 2017-12-17 14:14:31 +10:00
Nyall Dawson
069a0baa40 Expose some more export related settings to GUI 2017-12-17 14:14:31 +10:00
Nyall Dawson
56383e42b0 Port world file generation code to layouts 2017-12-17 14:14:31 +10:00
Nyall Dawson
afbd1400a5 Port georeferencing from compositions 2017-12-17 14:14:31 +10:00
Nyall Dawson
94b63d17b7 Fix updating gui after undoing layout settings change 2017-12-17 14:14:31 +10:00
Nyall Dawson
aa7986f8fc Implement methods for exporting layouts as raster, add tests 2017-12-17 14:14:31 +10:00
Nyall Dawson
fe5bd47eb0 Work on resizing layouts to item bounds 2017-12-17 14:14:31 +10:00
Nyall Dawson
f4f5f75b80 Remove incorrect TransferThis annotation 2017-12-17 14:14:31 +10:00
Denis Rouzaud
be8d1d7782 run sipify 2017-12-16 10:45:52 -04:00
lbartoletti
313417ddf1 Stop conflicts 2017-12-16 08:48:36 +01:00
lbartoletti
972e7890bc
Merge branch 'master' into segment_intersection 2017-12-16 07:54:03 +01:00
Denis Rouzaud
c604d2dda6 run sipify 2017-12-15 22:13:44 -04:00
Nyall Dawson
9d251198a6
Merge pull request #5870 from nyalldawson/virtual
Drop redundant virtual keywords on overrides
2017-12-16 11:03:04 +11:00
Denis Rouzaud
978d9277cf better argument names for QgsGeometryUtils::lineIntersection 2017-12-15 19:44:59 -04:00
Nyall Dawson
71a39cbce4 Sipify 2017-12-16 08:51:41 +10:00
Nyall Dawson
8802482778 Remove redundant overridden default destructor implementations 2017-12-16 08:50:55 +10:00
Nyall Dawson
4da1ce8404 Drop redundant virtual keywords on overrides
Run clang-tidy modernize-use-override to remove all the redundant
virtual keywords from overridden methods, and add some missing
overrides.

Another benefit is that this has also added the overrides
on destructors, which will cause a build failure if a base
class is missing a virtual destructor.
2017-12-16 08:49:36 +10:00
lbartoletti
c5d9663191
Merge branch 'master' into segment_intersection 2017-12-15 20:42:00 +01:00
lbartoletti
72f5adf368 Add default value to epsilon.
Change example for python.
2017-12-15 20:36:57 +01:00
Denis Rouzaud
f2b3ed0a9b run sipify 2017-12-15 11:12:19 -04:00
Nyall Dawson
96c2ce18bd Show a warning when loading a project with a transform not available locally 2017-12-15 17:32:00 +10:00
Nyall Dawson
318735271e Add method to retrieve datum transform ID from a proj string 2017-12-15 16:42:40 +10:00
Nyall Dawson
13d1786265 Sipify 2017-12-15 14:20:57 +10:00
Denis Rouzaud
6188b167fc missing const ref, remove extra argument 2017-12-15 14:16:59 +10:00
Nyall Dawson
69c3debfc0 Nicer API for datum transforms
Instead of using QPairs of ints, use more descriptive structs, also
rename a lot of datum related methods for clarity and add docs
2017-12-15 14:16:59 +10:00
Denis Rouzaud
44ed7bd9fb define default transforms in global options
adds QgsCoordinateTransformContext::readSettings()/writeSettings to read/write from settings
2017-12-15 14:15:02 +10:00
Denis Rouzaud
4eab13df8a datum transforms have reversible source/dest 2017-12-15 14:14:48 +10:00
Nyall Dawson
d2353e7c01 Add method to determine whether transform context has a valid transform
for a specific src/dest CRS pair
2017-12-15 14:14:47 +10:00
Denis Rouzaud
e303f746e1 ifdef 0 single source/destination transforms 2017-12-15 14:14:47 +10:00
Nyall Dawson
3916628212 Fix handling of transform-not-required in QgsCoordinateTransformContext 2017-12-15 14:14:26 +10:00
Nyall Dawson
cb693a72f9 Move caching to QgsCoordinateTransform
and remove no longer required QgsCoordinateTransformCache singleton
2017-12-15 14:14:08 +10:00
Nyall Dawson
018bfb49f9 Remove QgsDatumTransformStore
and port usage over to QgsCoordinateTransformContext instead
2017-12-15 14:13:52 +10:00
Nyall Dawson
fed8a6786e Add transform context to QgsMapSettings and QgsRenderContext
And also throw warnings when the context isn't set for these objects
2017-12-15 14:13:22 +10:00
Nyall Dawson
620139054d Add explicit setter for project's transform context
And add transformContextChanged signal, so that we can detect
when the context is changed.
2017-12-15 14:13:22 +10:00
Nyall Dawson
86d9492372 Remove context-unaware QgsCoordinateTransform constructors from Python bindings
This forces Python code and plugins to become datum transform
aware, and given that upgrading python code is easy (just
add QgsProject.instance() as a new argument to the constructor)
it's relatively painless to force this on PyQGIS users.

Also fix upgrade the easy QgsCoordinateTransform c++ constructors
where the project is available, or where using QgsProject::instance()
is safe to do.

For others, just avoid the deprecated warnings until we can
get access to the correct project instance where the transform
is being constructed.
2017-12-15 14:13:22 +10:00
Nyall Dawson
91e0afb613 Add QgsCoordinateTransformContext arguments to QgsCoordinateTransform constructor
And automatically retrieve correct datum transforms for the
transform, based on the information in the context.

Also add a convenience constructor which takes a QgsProject
instance instead of a QgsCoordinateTransformContext and which
automatically retrieves the project's transform context and uses
that. This is designed to make it easy to upgrade existing
Python code (by adding just QgsProject.instance() to the transform
constructors).
2017-12-15 14:12:16 +10:00
Nyall Dawson
76ebfdf2f6 Add a QgsCoordinateTransformContext member to QgsProject 2017-12-15 14:11:38 +10:00