15 Commits

Author SHA1 Message Date
Denis Rouzaud
f2b3ed0a9b run sipify 2017-12-15 11:12:19 -04:00
Denis Rouzaud
e48cf98edb run sipify 2017-12-06 07:19:50 -04:00
Martin Dobias
23a7bd0fd9 Introduce QgsReadWriteContext that encapsulates QgsPathResolver
This should make the read/write methods more flexible if we need to give them extra context.
2017-05-13 18:09:26 +08:00
Martin Dobias
8ffd91ea90 Propagate path resolver through renderers, annotations, diagrams
This is necessary in order to be able to correctly translate between absolute and relative paths
deeper in the code - e.g. paths to SVG files used in marker or fill symbols.

Until now, relative paths were translated to absolute paths on the fly.
This is now changed - paths to files should be always absolute within QGIS objects - and paths
only get turned into relative when saving projects. When loading a project, relative paths
are translated to absolute paths immediately.

This should lower the overall confusion about relative/absolute paths within QGIS, and also
allow having different base directories for relative paths (e.g. QML or QPT files may use relative paths
to their directory - rather than to the project directory)
2017-05-13 18:02:19 +08:00
Matthias Kuhn
28a21209b9 [sipify] seealso 2017-04-30 16:52:05 +02:00
Denis Rouzaud
1bfa539df1 [sipify] remove extra blank line 2017-04-24 07:39:30 +02:00
Denis Rouzaud
8f2a5c7c00 sipify all 2017-04-20 14:21:36 +02:00
Nyall Dawson
dce3c88b06 Add methods to clone annotations 2017-04-20 13:39:36 +10:00
Nyall Dawson
87a670848b [sipify] Always add virtual keyword for overridden methods
sip often requires the virtual keyword to be present, or
it chokes on covariant return types in overridden methods
2017-04-18 11:14:01 +10:00
Nyall Dawson
bfd37e1122 [sipify] Add return types for functions in docstrings
and change \return -> :return: in docystrings
2017-04-08 09:48:48 +10:00
Matthias Kuhn
58d2d6d7f9 sipify_all 2017-04-07 12:26:30 +02:00
Nyall Dawson
9b3539ab07 Update sip files 2017-04-03 13:18:36 +10:00
Nyall Dawson
0c08fb3b35 More sipify blacklist removal 2017-04-02 21:24:19 +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