50 Commits

Author SHA1 Message Date
Nyall Dawson
a87d352bd7 Run clang-tidy modernize-use-default-member-init to move member
initialization to headers (c++11 style)
2017-09-27 05:02:34 +10:00
Nyall Dawson
31c1ae1c6a Add missing QStringLiterals 2017-09-25 17:12:03 +10:00
Nyall Dawson
700f9b2ef8 Condense qgstestutils.h and qgstest.h into a single file 2017-09-04 10:38:18 +10:00
Nyall Dawson
21a3b8a4f3 Use QGSCOMPARENEAR instead of QVERIFY( qgsDoubleNear(... ) )
QGSCOMPARENEAR gives better debugging output when the
test fails
2017-08-29 12:39:59 +10:00
Nyall Dawson
936125555f Forward port test for #16517 2017-05-18 07:29:05 +10:00
Nyall Dawson
58ded28974 [composer] Correctly handle restoring map layer style overrides from template
(when template was created in a different project)

On behalf of Faunalia, sponsored by ENEL
2017-04-19 09:57:44 +10:00
Nyall Dawson
5b6b035d83 Correctly handle restoring atlas coverage layer from template
(when template was created in a different project)

On behalf of Faunalia, sponsored by ENEL
2017-04-19 09:57:43 +10:00
Nyall Dawson
2ca70dc48a [composer] Correctly restore map item layers when loading a template
in a different project to that which the template was created in

On behalf of Faunalia, sponsored by ENEL
2017-04-18 16:36:19 +10:00
Nyall Dawson
eb1e8205e1 [composer] Use weak layer reference matching when loading attribute table from XML
Allows attribute tables in templates to reattach to matching layers
when loaded in a different project to the project the template was
created in.

On behalf of Faunalia, sponsored by ENEL
2017-04-18 16:36:19 +10:00
Nyall Dawson
0b36ee3aac Use weak layer references and loose matching for composer legend
customisation

Allows legend customisation to be restored when loading a composer
template

Fix #2738
2017-04-18 10:27:05 +10:00
Nyall Dawson
da5c0ed2cd Fix composer legends are not restored from XML
Also add unit test to protect this and switch to unique_ptrs
instead of raw pointers
2017-04-12 16:59:54 +10:00
Juergen E. Fischer
b9162dccdf scripts/astyle-all.sh run 2017-03-03 15:37:12 +01:00
Nyall Dawson
47683fca4f [needs-docs] Rename Outline and Border -> Stroke
This change is being driven by:

- need for consistent terminology in the api. Currently there's
a confusing mix of border/outline used
- need for consistent terminology in the gui - we have a mix
of "border"/"outline"/"pen"
- bringing QGIS into line with the standard terminology used
in other graphic editing programs
2017-02-22 19:22:45 +10:00
Nyall Dawson
d19e70700f Ensure all pointer variables are initialized to nullptr 2017-02-18 20:23:18 +10:00
Nyall Dawson
a188d14f48 Remove map settings parameter from QgsComposition
Breaks the hard link between canvas and compositions!

Fix #11077
2017-01-24 14:32:08 +10:00
Nyall Dawson
6a4d605256 Fix some test failures 2017-01-18 07:38:06 +10:00
Nyall Dawson
f32d11b508 [composer] Use largest map in composition as reference map if no
reference map is explicitly set
2017-01-16 15:52:19 +10:00
Nyall Dawson
e0934d7766 [composer][needs-docs] Rename "world file map" option to "reference map"
This option will be used for more than just world file generation,
and instead will indicate which map should be considered the master
map for the composition from which any composer properties
calculating map units will derive the scale from.
2017-01-16 15:52:19 +10:00
Nyall Dawson
db1009cbfa [FEATURE] New expression variables for map settings
- map_crs, map_crs_definition: retrieves crs details for map
- map_units: retrieves units for map (eg 'meters','degrees')
2017-01-11 12:26:32 +10:00
Nyall Dawson
f2032ea268 [FEATURE] item_variables expression function inside compositions
This adds a new item_variables expression function when expressions
are used inside a composition context.

The function takes a single argument, the id for an item inside
the composition, and returns a map of variable name to value
for that item.

This allows you to do things like insert text in a label fetching
properties of another item in the composition, eg

Insert scale of map into a label:

map_get( item_variables( 'map'),'map_scale')

Insert x coordinate of map center into a label:

x(map_get( item_variables( 'map'),'map_extent_center'))
2017-01-11 12:26:32 +10:00
Martin Dobias
8c340f7144 Make composition associated with QgsProject (#3957)
... rather than using project singleton within compositions
2017-01-06 17:22:34 +08:00
Matthias Kuhn
dfd9833467 Let all tests work with a proper QgsApplication instance 2016-12-20 01:20:08 +01:00
Nyall Dawson
4166a3ea62 Fix most clazy qstring-unneeded-heap-allocations warnings
By flipping string literals to QStringLiteral/QLatin1String

see

https://woboq.com/blog/qstringliteral.html
2016-10-24 15:26:24 +10:00
Juergen E. Fischer
3f22a7a77f another scripts/replacev2.sh with minor manual fixes 2016-08-10 12:12:28 +02:00
Juergen E. Fischer
0688621046 scripts/replacev2.sh run 2016-08-10 12:08:52 +02:00
Nyall Dawson
f6b09eaee1 Add Distance*, Area*, Angle* prefixes to QgsUnitTypes enum values 2016-07-26 08:29:24 +10:00
Nyall Dawson
f6f5010131 Move QGis::UnitType to QgsUnitTypes::DistanceUnit
This change consolidates more unit handling and conversion into
QgsUnitTypes.

Additionally, UnknownUnit was renamed to UnknownDistanceUnit.
All methods which accepted QGis::UnitType parameters have been
updated to take QgsUnitTypes::DistanceUnit instead.

ALso remove the unit handling methods toLiteral, fromLiteral, tr,
fromTr, and fromUnitToUnitFactor from QGis. Their corresponding
counterparts in QgsUnitTypes should be used instead.
2016-07-25 14:47:16 +10:00
Nyall Dawson
1a2231f10c Rename QGis class to Qgis, for capitalisation consistency 2016-07-21 22:01:38 +10:00
Nyall Dawson
4cfacf14e3 Make API more consistent
- rename methods with XML to Xml, CRS to Crs, WMS to Wms, ID to Id
- rename methods with SRS to Crs
- rename methods with abbreviations like "dest" to "destination"
- rename methods with abbreviations like "src" to "source"
2016-07-21 08:40:50 +10:00
Nyall Dawson
c7ffdfa5e9 Make sure variable editor widgets always show current variables
On behalf of Faunalia, sponsored by ENEL
2016-07-19 12:00:35 +10:00
Nyall Dawson
7af33661eb Fix leak in test 2016-06-02 13:18:56 +10:00
Nyall Dawson
bae8a0e5e0 [FEATURE] Georeference outputs (eg PDF) from composer
This commit makes composer automatically georeference outputs
(where output format makes this possible, eg TIF and PDF).

The existing option to create a world file has been separated
from the map selection for georeferencing. The new behaviour
is to always georeference outputs, and only create the
separate world file if that option is checked.
2016-05-29 00:46:39 +10:00
Nyall Dawson
eb31e01a2f Move QgsCompositionChecker to core, speeds up compilation with
tests enabled
2016-03-07 09:38:36 +11:00
Nyall Dawson
dd759370bd [FEATURE][composer] Option to restrict image/SVG outputs to content
If selected, then the images output by composer will include only
the area of the composition with content. There's also an option
for margins to add around the item bounds if required.

If the composition includes a single page, then the output will
be sized to include EVERYTHING on the composition. If it's a
multi-page composition, then each page will be cropped to only
include the area of that page with items.

A new image export options dialog has been added to facilitate
this, which also includes handy shortcuts for overriding the
print resolution or exported image dimensions.

Sponsored by NIWA
2015-09-25 18:55:35 +10:00
Nyall Dawson
2f343008c1 [FEATURE][composer] Add fit page to contents option
New option in the composition panel, with optional extra margins
to add

Sponsored by NIWA
2015-09-25 18:55:35 +10:00
Nyall Dawson
3898d840bd Custom properties for QgsComposition and QgsComposerObject 2015-08-11 20:32:14 +10:00
Juergen E. Fischer
83bb33cad5 cleanup composer test map settings 2015-07-05 11:20:13 +02:00
Juergen E. Fischer
5b54e260d4 various windows test fixes:
* .gitignore sort and remove duplicates
* show more warnings in tests
* add/update masks for rendering checks on windows
* fix delimited text provider tests
* disable QgsLogger and QgsPalLabelingServer on windows
2015-07-05 03:45:01 +02:00
Juergen E. Fischer
9b976cfe26 test cleanups and some fixes 2015-07-02 04:22:52 +02:00
Denis Rouzaud
9e3183c63f Revert "sort includes"
This reverts commit 2b7d3d3c73b50ba6dc74abec6dd652ff1b87c0ec.
2015-06-10 14:54:47 +02:00
Juergen E. Fischer
4e86109398 indentation update 2015-06-10 14:51:53 +02:00
Denis Rouzaud
2b7d3d3c73 sort includes 2015-06-10 13:59:08 +02:00
Nyall Dawson
5160d467cb More (probably harmless) uninitialized variables in tests 2015-02-07 13:16:03 +11:00
Juergen E. Fischer
bff64fdef9 indentation update 2014-12-30 22:47:09 +01:00
Nyall Dawson
118a9f63dc Add some missing exitQgis() calls to unit tests
Also ensure that compositions are deleted before exiting
Qgis during tests.
2014-12-01 19:52:04 +11:00
Matthias Kuhn
cae6baea90 Formatting of tests 2014-11-21 11:45:33 +01:00
Matthias Kuhn
78c519546a Add Qt5 support 2014-11-21 11:45:32 +01:00
Matthias Kuhn
1c2bdf1ea3 Switch tests to automoc
Required for Qt5 compatibility
Raises minimum CMake version to 2.8.6
2014-11-04 09:18:26 +01:00
Nyall Dawson
8c502c19fc [composer] Fix pages are added but never removed with multiframe resizing 2014-09-29 22:19:08 +10:00
Nyall Dawson
272b79b6ca [FEATURE][composer] Add checkbox to frame items for preventing export
of page containing frame when frame is empty. This change allows
users to create multiple pages containing extra frames for multiframe
items (currently HTML and Attribute Table items), which are then only
printed/exported if required. Sponsored by the City of Uster, Switzerland.
2014-09-26 01:08:07 +10:00