357 Commits

Author SHA1 Message Date
Nyall Dawson
49b426d951 Make doxygen_space script convert multiline //! comments
Because:
- the /** format is much more prevalent throughout QGIS
- sipify works correctly with /**
2017-10-06 07:55:52 +10:00
Nyall Dawson
92af1dacaf Replace default constructors/destructors with = default 2017-10-01 06:52:14 +10:00
Nyall Dawson
60b8ec5488 Sip sync 2017-09-25 17:11:46 +10:00
Nyall Dawson
cdb0ace28e Try to fix sip item casting clashing between composer items and layout items
Add a temporary hack to QgsComposerItem subclassing to handle this
for now.
2017-07-25 12:54:58 +10:00
Denis Rouzaud
54c6291378 script to write include SIP files 2017-06-28 10:45:51 +02:00
Denis Rouzaud
009e47e369 fix tests 2017-06-20 15:36:04 +02:00
Denis Rouzaud
eddd258725 sipify core composer part 4 2017-06-20 15:36:04 +02:00
Denis Rouzaud
c9a75090bc sipify core composer part 3 2017-06-20 15:36:04 +02:00
Denis Rouzaud
b52f7c2975 sipify core composer part 2 2017-06-20 15:36:04 +02:00
Denis Rouzaud
01ffc4edc7 sipify core composer part 1* 2017-06-20 15:36:04 +02:00
Mathieu Pellerin
7fff6cf029 [atlas] move file format for image export to atlas widget
Two big wins:
- remember file format across sessions (no more accidental
.bmp atlas export!)
- use native directory picker
2017-06-20 10:53:31 +07:00
Nyall Dawson
b2e102d2f5 Improve API docs 2017-06-09 11:56:14 +10:00
Nyall Dawson
aaddfedda8 [composer] Allow map rotation from -360 to 360
Fix #15823

Also reenable instant map refresh as map rotation changes. Since
map refresh is done in the background now, this is safe to reenable.
2017-05-30 17:18:41 +10:00
Nyall Dawson
39146517d2 Change QgsComposerItem to use opacity instead of transparency 2017-05-30 08:48:54 +10:00
Denis Rouzaud
922b162b86 attachment widget: data defined button for document type 2017-05-15 17:57:25 +02:00
Nyall Dawson
29c87de679 [needs-docs][composer] Remove Render/Cache modes from composer maps
Make maps invalidate cache whenever layer order changes. Cache mode
is now identical to Render mode, so  all mode switching has been
removed from composer maps. This should greatly simplify the learning
curve and usability of composer maps.
2017-05-08 19:31:55 +10:00
Nyall Dawson
5e3b903955 [needs-docs][composer] Remove Rectangle mode from composer maps
No longer required - the Cache mode is now performant enough
that we don't have to rely on the old rectangle preview
when desiring responsive composers
2017-05-08 17:10:07 +10:00
Nyall Dawson
491abc2b66 sipify QgsComposerMap 2017-05-08 17:10:02 +10:00
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