QGIS API Documentation 3.36.0-Maidenhead (09951dc0acf)
|
Abstract base class for annotation items which are drawn with QgsAnnotationLayers. More...
#include <qgsannotationitem.h>
Public Member Functions | |
QgsAnnotationItem ()=default | |
Constructor for an annotation item. | |
QgsAnnotationItem (const QgsAnnotationItem &other)=delete | |
QgsAnnotationItem cannot be copied. | |
virtual | ~QgsAnnotationItem ()=default |
virtual Qgis::AnnotationItemEditOperationResult | applyEdit (QgsAbstractAnnotationItemEditOperation *operation) |
Applies an edit operation to the item. | |
virtual QgsRectangle | boundingBox () const =0 |
Returns the bounding box of the item's geographic location, in the parent layer's coordinate reference system. | |
virtual QgsRectangle | boundingBox (QgsRenderContext &context) const |
Returns the bounding box of the item's geographic location, in the parent layer's coordinate reference system. | |
virtual QgsAnnotationItem * | clone () const =0 |
Returns a clone of the item. | |
bool | enabled () const |
Returns true if the item is enabled and will be rendered in the layer. | |
virtual Qgis::AnnotationItemFlags | flags () const |
Returns item flags. | |
virtual QList< QgsAnnotationItemNode > | nodes () const |
Returns the nodes for the item, used for editing the item. | |
QgsAnnotationItem & | operator= (const QgsAnnotationItem &other)=delete |
QgsAnnotationItem cannot be copied. | |
virtual bool | readXml (const QDomElement &element, const QgsReadWriteContext &context)=0 |
Reads the item's state from the given DOM element. | |
virtual void | render (QgsRenderContext &context, QgsFeedback *feedback)=0 |
Renders the item to the specified render context. | |
void | setEnabled (bool enabled) |
Sets if the item will be rendered or not in the layer. | |
void | setSymbologyReferenceScale (double scale) |
Sets the annotation's symbology reference scale. | |
void | setUseSymbologyReferenceScale (bool enabled) |
Sets whether the annotation item uses a symbology reference scale. | |
void | setZIndex (int index) |
Sets the item's z index, which controls the order in which annotation items are rendered in the layer. | |
double | symbologyReferenceScale () const |
Returns the annotation's symbology reference scale. | |
virtual QgsAnnotationItemEditOperationTransientResults * | transientEditResults (QgsAbstractAnnotationItemEditOperation *operation) |
Retrieves the results of a transient (in progress) edit operation on the item. | |
virtual QString | type () const =0 |
Returns a unique (untranslated) string identifying the type of item. | |
bool | useSymbologyReferenceScale () const |
Returns true if the annotation item uses a symbology reference scale. | |
virtual bool | writeXml (QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const =0 |
Writes the item's state into an XML element. | |
int | zIndex () const |
Returns the item's z index, which controls the order in which annotation items are rendered in the layer. | |
Protected Member Functions | |
void | copyCommonProperties (const QgsAnnotationItem *other) |
Copies common properties from the base class from an other item. | |
bool | readCommonProperties (const QDomElement &element, const QgsReadWriteContext &context) |
Reads common properties from the base class from the given DOM element. | |
bool | writeCommonProperties (QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const |
Writes common properties from the base class into an XML element. | |
Abstract base class for annotation items which are drawn with QgsAnnotationLayers.
Definition at line 40 of file qgsannotationitem.h.
|
default |
Constructor for an annotation item.
|
delete |
QgsAnnotationItem cannot be copied.
|
virtualdefault |
|
virtual |
Applies an edit operation to the item.
Reimplemented in QgsAnnotationLineItem, QgsAnnotationLineTextItem, QgsAnnotationMarkerItem, QgsAnnotationPointTextItem, and QgsAnnotationPolygonItem.
Definition at line 26 of file qgsannotationitem.cpp.
|
pure virtual |
Returns the bounding box of the item's geographic location, in the parent layer's coordinate reference system.
Implemented in QgsAnnotationLineItem, QgsAnnotationLineTextItem, QgsAnnotationMarkerItem, QgsAnnotationPointTextItem, and QgsAnnotationPolygonItem.
|
inlinevirtual |
Returns the bounding box of the item's geographic location, in the parent layer's coordinate reference system.
Reimplemented in QgsAnnotationLineTextItem, QgsAnnotationMarkerItem, and QgsAnnotationPointTextItem.
Definition at line 117 of file qgsannotationitem.h.
|
pure virtual |
Returns a clone of the item.
Ownership is transferred to the caller.
Implementations should include a call to copyCommonProperties() to copy the base class properties.
Implemented in QgsAnnotationLineItem, QgsAnnotationLineTextItem, QgsAnnotationMarkerItem, QgsAnnotationPointTextItem, and QgsAnnotationPolygonItem.
|
protected |
Copies common properties from the base class from an other item.
Definition at line 41 of file qgsannotationitem.cpp.
|
inline |
Returns true
if the item is enabled and will be rendered in the layer.
Definition at line 183 of file qgsannotationitem.h.
|
virtual |
Returns item flags.
Reimplemented in QgsAnnotationLineTextItem, QgsAnnotationMarkerItem, and QgsAnnotationPointTextItem.
Definition at line 21 of file qgsannotationitem.cpp.
|
virtual |
Returns the nodes for the item, used for editing the item.
Reimplemented in QgsAnnotationLineItem, QgsAnnotationLineTextItem, QgsAnnotationMarkerItem, QgsAnnotationPointTextItem, and QgsAnnotationPolygonItem.
Definition at line 36 of file qgsannotationitem.cpp.
|
delete |
QgsAnnotationItem cannot be copied.
|
protected |
Reads common properties from the base class from the given DOM element.
Definition at line 58 of file qgsannotationitem.cpp.
|
pure virtual |
Reads the item's state from the given DOM element.
Implementations should include a call to readCommonProperties() to read the base class properties.
Implemented in QgsAnnotationLineItem, QgsAnnotationLineTextItem, QgsAnnotationMarkerItem, QgsAnnotationPointTextItem, and QgsAnnotationPolygonItem.
|
pure virtual |
Renders the item to the specified render context.
The feedback argument can be used to detect render cancellations during expensive render operations.
Implemented in QgsAnnotationLineItem, QgsAnnotationLineTextItem, QgsAnnotationMarkerItem, QgsAnnotationPointTextItem, and QgsAnnotationPolygonItem.
|
inline |
Sets if the item will be rendered or not in the layer.
Definition at line 191 of file qgsannotationitem.h.
|
inline |
Sets the annotation's symbology reference scale.
The reference scale will only be used if useSymbologyReferenceScale() returns true
.
This represents the desired scale denominator for the rendered map, eg 1000.0 for a 1:1000 map render.
The symbology reference scale is an optional property which specifies the reference scale at which symbology in paper units (such a millimeters or points) is fixed to. For instance, if the scale is 1000 then a 2mm thick line will be rendered at exactly 2mm thick when a map is rendered at 1:1000, or 1mm thick when rendered at 1:2000, or 4mm thick at 1:500.
Definition at line 248 of file qgsannotationitem.h.
|
inline |
Sets whether the annotation item uses a symbology reference scale.
Definition at line 214 of file qgsannotationitem.h.
|
inline |
Sets the item's z index, which controls the order in which annotation items are rendered in the layer.
Definition at line 175 of file qgsannotationitem.h.
|
inline |
Returns the annotation's symbology reference scale.
The reference scale will only be used if useSymbologyReferenceScale() returns true
.
This represents the desired scale denominator for the rendered map, eg 1000.0 for a 1:1000 map render.
The symbology reference scale is an optional property which specifies the reference scale at which symbology in paper units (such a millimeters or points) is fixed to. For instance, if the scale is 1000 then a 2mm thick line will be rendered at exactly 2mm thick when a map is rendered at 1:1000, or 1mm thick when rendered at 1:2000, or 4mm thick at 1:500.
Definition at line 231 of file qgsannotationitem.h.
|
virtual |
Retrieves the results of a transient (in progress) edit operation on the item.
Reimplemented in QgsAnnotationLineItem, QgsAnnotationLineTextItem, QgsAnnotationMarkerItem, QgsAnnotationPointTextItem, and QgsAnnotationPolygonItem.
Definition at line 31 of file qgsannotationitem.cpp.
|
pure virtual |
Returns a unique (untranslated) string identifying the type of item.
Implemented in QgsAnnotationLineItem, QgsAnnotationLineTextItem, QgsAnnotationMarkerItem, QgsAnnotationPointTextItem, and QgsAnnotationPolygonItem.
|
inline |
Returns true
if the annotation item uses a symbology reference scale.
Definition at line 206 of file qgsannotationitem.h.
|
protected |
Writes common properties from the base class into an XML element.
Definition at line 49 of file qgsannotationitem.cpp.
|
pure virtual |
Writes the item's state into an XML element.
Implementations should include a call to writeCommonProperties() to store the base class properties.
Implemented in QgsAnnotationLineItem, QgsAnnotationLineTextItem, QgsAnnotationMarkerItem, QgsAnnotationPointTextItem, and QgsAnnotationPolygonItem.
|
inline |
Returns the item's z index, which controls the order in which annotation items are rendered in the layer.
Definition at line 167 of file qgsannotationitem.h.