qgis / qgis4.0_api

Tracker for QGIS 4.0 API related issues and developer discussion
3 stars 1 forks source link

QgsAnnotationItem is not accessible from CORE #3

Closed nyalldawson closed 7 years ago

nyalldawson commented 8 years ago

Currently QgsAnnotationItem is in the GUI library, and not accessible from CORE. This creates issues with composer handling annotations in the map. Currently composer uses a huge hack and casts annotations to QGraphicsItems to display them in composer maps, but this has limited value.

An example is http://hub.qgis.org/issues/10172 - to fix this requires access from composer to QgsHtmlAnnotationItem::vectorLayer(), but this is not possible.

A complication is that QgsMapCanvasItem requires the QgsMapCanvas class, which obviously belongs in GUI. Possibly a new base class for QgsAnnotationItem could be created in core, and annotations could use multiple inheritance from both QgsMapCanvasItem and this new class.

nyalldawson commented 7 years ago

Done in https://github.com/qgis/QGIS/pull/4073

nyalldawson commented 7 years ago

Fixed