339 Commits

Author SHA1 Message Date
Denis Rouzaud
85f3b81b55 remove double spaces in sip files
fix indentation
2017-05-03 08:02:14 +02:00
Denis Rouzaud
7d459149c7 [sip] align missing bits and replace nullptr by 0 2017-05-02 08:09:53 +02:00
Denis Rouzaud
7b60d89d6c align pointer and reference in sip files batch 2 2017-05-01 20:00:51 +02:00
Nyall Dawson
b40bc0c1f7 Refactor scale bar rendering
Move all scalebar rendering code out of composer and ensure that
all scalebar rendering is done independant of QgsComposerScaleBar

This allows scalebar rendering code to be reused by plugins
and by non-composer code.

Also rename QgsScaleBarStyle -> QgsScaleBarRenderer, (and all
subclasses too). This name better reflects what these classes do.
2017-04-26 11:46:51 +10:00
Matthias Kuhn
f33aabd90a Completely move layer order to core 2017-03-23 15:29:12 +01:00
Nyall Dawson
77706a6447 Avoid multiple map/legend renders while loading compositions 2017-03-21 10:32:53 +10:00
Nyall Dawson
041129d507 Fix loading composition triggers render of all composer maps
Also cleanup some more unused API methods
2017-03-21 10:32:53 +10:00
Nyall Dawson
54d1a93c17 Add missing TransferThis annotation 2017-03-21 10:32:53 +10:00
Nyall Dawson
885269ee78 Only create composer item config widgets on demand
Instead of creating them for all items when composer window
is opened, instead just create and destroy them when
required. None are too heavy to have a noticable delay
when selecting items, but in contrast keeping them around
forever is wasteful on memory.

Also clean up a lot of duplicate composer/composition
code and remove unnecessary signals from api (use a single
itemAdded signal instead of multiple signals for every
item type)
2017-03-21 10:32:53 +10:00
Nyall Dawson
53160c7b21 [composer] Port composer manager to layout manager
Also switch to using a proper model to show/edit compositions
in the dialog.
2017-03-21 10:32:53 +10:00
Nyall Dawson
148e2bcf52 Better method to autogenerate composer names 2017-03-21 10:32:53 +10:00
Nyall Dawson
8c8ac61512 Port composer template saving and duplicating to layout manager 2017-03-21 10:32:52 +10:00
Nyall Dawson
3a1ac1a995 [composer] Attach compositions to QgsProject
This adds a new QgsLayoutManager class which is used for
storage and serializing/deserializing of compositions.

A QgsLayoutManager is attached to QgsProject. This allows
core code to access the compositions attached to a project.
The intention is to move all handling of compositions from
app to core, making it easy for server to access project
compositions without resorting to fragile xml parsing.
2017-03-21 10:32:52 +10:00
Nyall Dawson
ae45d8d490 Move composer title to composition name
Allows the name to be retrieved from core code
2017-03-15 15:19:13 +10: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
Denis Rouzaud
7812d4fb17 remove the-prefix from source code
this might result in variables having the same name as some methods
2017-02-21 18:14:58 +01:00
Nyall Dawson
54089ff710 Follow up 4a3871, fix broken data defined properties
(definitions are often accessed before a QgsSymboLayer/etc
is constructed)
2017-02-05 14:27:26 +10:00
Nyall Dawson
1fce65707c Add missing annotation api break docs, fix sip binding 2017-01-31 12:58:51 +10:00
Nyall Dawson
ad184cdeed [composer] Remove last link between composer maps and canvas
you WILL respect the separation between core and gui!!\!
2017-01-30 15:09:27 +10:00
Nyall Dawson
4058f4734b Annotations are now handled at a project level
This commit implements a new QgsAnnotationManager class, which
handles storage, writing and retrieval of annotations.

QgsProject has an annotationManager() attached to it. Map canvases
sync their visible QgsMapCanvasAnnotationItems to the annotations
contained within the project's annotation manager.

This moves all management, storage and retrieval of annotations
up to core and out of app/canvas.
2017-01-30 14:57:16 +10:00
Nyall Dawson
c853f4fe89 Refactor annotations
Splits the rendering component of annotations out from map
canvas item component.

A new core abstract base class QgsAnnotation handles the
management of the common properties associated with an
annotation, and handles rendering the annotation onto a
QgsRenderContext destination.

Existing annotation classes have been ported to this, and
with the exception of the form annotation moved into core.
Form annotations are dependant on editor widgets and must
remain in GUI.

A new QgsMapCanvasAnnotationItem item class implements
a QgsMapCanvasItem which draws an annotation inside the
canvas, and handles synchronising the position and size
of the canvas item with the QgsAnnotation position/size.

This allows annotations to be safely used in a multi-canvas
environment, with a single QgsAnnotation being displayed
in multiple canvases (even if the canvases have different
extent/crs/etc).

Additionally it allows annotations to be directly rendered
to a map (eg in composer) without going through the
gui based Qt graphics scene framework.

Also removes lots of duplicate code, and adds some basic
unit tests for annotations.
2017-01-30 08:36:19 +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
Juergen E. Fischer
6a56cb0dd0 updates and fixes for windows qt5/py3 build 2017-01-24 01:25:59 +01:00
Nyall Dawson
39b89d1bac SIP sync 2017-01-23 12:45:22 +10:00
Nyall Dawson
ffaa40edc4 Refactor properties
Remove QgsAbstractProperty and subclasses, and instead use a single
QgsProperty class which covers the use of QgsAbstractProperty
and its subclasses. This simplifies the API and avoids pointer
handling. QgsProperty is implicitly shared for memory efficiency
and inexpensive copies.
2017-01-23 12:45:21 +10:00
Nyall Dawson
6c53ba25e3 [FEATURE][composer] Data defined scalebar colors and line width 2017-01-23 12:45:21 +10:00
Nyall Dawson
ec9ba9c2a2 [FEATURE][composer] Data defined legend titles and column count
(fix #11913)
2017-01-23 12:45:21 +10:00
Nyall Dawson
934c7c9173 [FEATURE][composer] Data defined svg colors and outline width for
composer picture items

Especially useful when the picture is showing a north arrow!
2017-01-23 12:45:21 +10:00
Nyall Dawson
d6c7569dda [FEATURE][composer] Data definable item frame and background colors 2017-01-23 12:45:21 +10:00
Nyall Dawson
ad2324021d Port symbology and composer to properties framework 2017-01-23 12:45:21 +10:00
Nyall Dawson
2183887759 Don't use canvas mapSettings when composer maps respond to layer changes 2017-01-19 06:08:44 +10:00
Nyall Dawson
a3dd380d35 [needs-docs] Composer maps default to a "use project CRS" setting
And overriding projection is only done if user has manually
chosen a different CRS from the list.

This means that templates and compositions in server can still
adapt to follow the project CRS, but if desired specific map
items (eg an overview map) can use the CRS override to always
show in a particular CRS.
2017-01-18 12:30:47 +10:00
Nyall Dawson
9a6d714061 [FEATURE][composer] Allow choice of CRS for map items
This allows the CRS for map items to differ from the canvas/project
CRS. It also allows different map items to have different CRS,
eg an overview map can be set to a different CRS to the main map.

An unfortunate side effect of this change and the ongoing work
to separate compositions from canvas is that datum transforms
are no longer supported in composer. This cannot be fixed until
the datum transform store is rewritten to not depend on canvas
(ie, it's also broken for upcoming multi-canvas work)
2017-01-17 19:18:47 +10:00
Nyall Dawson
305f9f0e98 Remove some more QgsComposition::mapSettings use 2017-01-17 15:44:46 +10:00
Nyall Dawson
e3ad5b1e3b [composer] Remove more use of composition map settings
Use relevant composer map item CRS instead of composition mapsetting's
CRS. For items directly linked to a map (eg scalebar, legend) we
use that map's CRS, for others (eg labels, html items) we use the
composition's reference map CRS.

(Note that the CRS cannot be set for a map, and is still currently
linked to the canvas CRS. Fixing that is a future TODO.)
2017-01-17 13:23:12 +10:00
Denis Rouzaud
0a63d1f2c2 [spellcheck] properly look into various cases and add more fixes" 2017-01-16 16:39:20 +01:00
Nyall Dawson
49411210b0 [composer] Remove QgsComposerMap::storeCurrentLayerSet
This method was used to sync the canvas layers to a composer map.
The logic has been moved to app to avoid a dependancy between
compositions and the main map canvas
2017-01-16 15:52:19 +10:00
Nyall Dawson
8a9cee0fb6 [composer] Use reference map when creating render context for
draw shape/arrow/nodes/paper symbols

This commit removes some more instances where changes in the
canvas affect compositions. Previously the symbols drawn
in shape/arrow/etc items were using the scale from the canvas.
This meant that the appearance of these items in composer
would change depending on canvas zoom if they used symbols
with map unit sizes.

Now they take their map scale from the composition's reference
map. While this has the nice side effect that now map units
can be used in the appearance of these items and they're
guaranteed to match up with the reference map item, the main
intention here is to remove more of the forced links between
compositions (core) and the main canvas (app).
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
6ffe50704f [composer] Remove support for upgrading pre 2.2 project atlas map
settings

Open the project in a recent 2.x release and resave to upgrade
the project
2017-01-14 19:14:48 +10:00
Nyall Dawson
231f6af0e1 Don't return const references to implicitly shared Qt classes
Instead return the inexpensive copies. Should provide extra safety
against issues like #14822

(refs #14822)
2017-01-14 15:53:45 +10:00
Denis Rouzaud
6c74e4ea5d spelling fixes 2017-01-12 22:01:50 +01:00
Denis Rouzaud
748be8de71 [spelling] replace behaviour by behavior 2017-01-11 11:35:19 +01:00
Denis Rouzaud
37ebcdd1cd [spellcheck] allow inwords checks and line skipping
spell check will be done automatically in words by default (when some conditions are fulfilled)
possibility to avoid in words checking by adding :* at the end in spelling.dat

one can add #spellok at the end of a line of code to skip spell check on this line
2017-01-10 20:18:37 +01: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
Harrissou Sant-anna
ef85cdcf83 Replace "eg" by "e.g." or "for example" 2016-12-30 00:03:22 +01:00
Mathieu Pellerin
a8b9723cbc [FEATURE] allow customization of line spacing for legend item labels (#3632)
* [FEATURE] allow customization of line spacing for legend item labels
* add test for legend line spacing and update control images
2016-12-13 12:09:13 +07:00
Martin Dobias
5228cc5fb4 One more fix for doc test 2016-12-12 10:34:03 +08:00
Martin Dobias
556582979a Rename QgsLegendModelV2 to QgsLegendModel 2016-12-12 03:27:14 +08:00
Martin Dobias
c783be1d04 Rename QgsComposerLegendStyle to QgsLegendStyle 2016-12-12 03:23:02 +08:00