Skip to content

Commit c853f4f

Browse files
committedJan 29, 2017
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.
1 parent 8ba609e commit c853f4f

File tree

81 files changed

+2402
-1715
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+2402
-1715
lines changed
 

‎doc/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ IF(WITH_APIDOC)
4848
SET(DOXYGEN_INPUT
4949
${CMAKE_SOURCE_DIR}/doc
5050
${CMAKE_SOURCE_DIR}/src/core
51+
${CMAKE_SOURCE_DIR}/src/core/annotations
5152
${CMAKE_SOURCE_DIR}/src/core/auth
5253
${CMAKE_SOURCE_DIR}/src/core/composer
5354
${CMAKE_SOURCE_DIR}/src/core/diagram

‎python/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ INCLUDE_DIRECTORIES(SYSTEM
9393
)
9494
INCLUDE_DIRECTORIES(
9595
../src/core
96+
../src/core/annotations
9697
../src/core/auth
9798
../src/core/pal
9899
../src/core/composer

0 commit comments

Comments
 (0)
Please sign in to comment.