QGIS API Documentation  3.18.1-Zürich (202f1bf7e5)
Public Member Functions | List of all members
QgsAnnotationItem Class Referenceabstract

Abstract base class for annotation items which are drawn with QgsAnnotationLayers. More...

#include <qgsannotationitem.h>

Inheritance diagram for QgsAnnotationItem:
Inheritance graph
[legend]

Public Member Functions

 QgsAnnotationItem ()=default
 Constructor for an annotation item. More...
 
 QgsAnnotationItem (const QgsAnnotationItem &other)=delete
 QgsAnnotationItem cannot be copied. More...
 
virtual ~QgsAnnotationItem ()=default
 
virtual QgsRectangle boundingBox () const =0
 Returns the bounding box of the item's geographic location, in the parent layer's coordinate reference system. More...
 
virtual QgsAnnotationItemclone ()=0
 Returns a clone of the item. More...
 
QgsAnnotationItemoperator= (const QgsAnnotationItem &other)=delete
 QgsAnnotationItem cannot be copied. More...
 
virtual bool readXml (const QDomElement &element, const QgsReadWriteContext &context)=0
 Reads the item's state from the given DOM element. More...
 
virtual void render (QgsRenderContext &context, QgsFeedback *feedback)=0
 Renders the item to the specified render context. More...
 
void setZIndex (int index)
 Sets the item's z index, which controls the order in which annotation items are rendered in the layer. More...
 
virtual QString type () const =0
 Returns a unique (untranslated) string identifying the type of item. More...
 
virtual bool writeXml (QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const =0
 Writes the item's state into an XML element. More...
 
int zIndex () const
 Returns the item's z index, which controls the order in which annotation items are rendered in the layer. More...
 

Detailed Description

Abstract base class for annotation items which are drawn with QgsAnnotationLayers.

Since
QGIS 3.16

Definition at line 38 of file qgsannotationitem.h.

Constructor & Destructor Documentation

◆ QgsAnnotationItem() [1/2]

QgsAnnotationItem::QgsAnnotationItem ( )
default

Constructor for an annotation item.

◆ QgsAnnotationItem() [2/2]

QgsAnnotationItem::QgsAnnotationItem ( const QgsAnnotationItem other)
delete

QgsAnnotationItem cannot be copied.

◆ ~QgsAnnotationItem()

virtual QgsAnnotationItem::~QgsAnnotationItem ( )
virtualdefault

Member Function Documentation

◆ boundingBox()

virtual QgsRectangle QgsAnnotationItem::boundingBox ( ) const
pure virtual

Returns the bounding box of the item's geographic location, in the parent layer's coordinate reference system.

Implemented in QgsAnnotationPolygonItem, QgsAnnotationPointTextItem, QgsAnnotationMarkerItem, and QgsAnnotationLineItem.

◆ clone()

virtual QgsAnnotationItem* QgsAnnotationItem::clone ( )
pure virtual

Returns a clone of the item.

Ownership is transferred to the caller.

Implemented in QgsAnnotationPolygonItem, QgsAnnotationPointTextItem, QgsAnnotationMarkerItem, and QgsAnnotationLineItem.

◆ operator=()

QgsAnnotationItem& QgsAnnotationItem::operator= ( const QgsAnnotationItem other)
delete

QgsAnnotationItem cannot be copied.

◆ readXml()

virtual bool QgsAnnotationItem::readXml ( const QDomElement &  element,
const QgsReadWriteContext context 
)
pure virtual

Reads the item's state from the given DOM element.

Implemented in QgsAnnotationPolygonItem, QgsAnnotationPointTextItem, QgsAnnotationMarkerItem, and QgsAnnotationLineItem.

◆ render()

virtual void QgsAnnotationItem::render ( QgsRenderContext context,
QgsFeedback feedback 
)
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 QgsAnnotationPolygonItem, QgsAnnotationPointTextItem, QgsAnnotationMarkerItem, and QgsAnnotationLineItem.

◆ setZIndex()

void QgsAnnotationItem::setZIndex ( int  index)
inline

Sets the item's z index, which controls the order in which annotation items are rendered in the layer.

See also
zIndex()

Definition at line 129 of file qgsannotationitem.h.

◆ type()

virtual QString QgsAnnotationItem::type ( ) const
pure virtual

Returns a unique (untranslated) string identifying the type of item.

Implemented in QgsAnnotationPolygonItem, QgsAnnotationPointTextItem, QgsAnnotationMarkerItem, and QgsAnnotationLineItem.

◆ writeXml()

virtual bool QgsAnnotationItem::writeXml ( QDomElement &  element,
QDomDocument &  document,
const QgsReadWriteContext context 
) const
pure virtual

Writes the item's state into an XML element.

Implemented in QgsAnnotationPolygonItem, QgsAnnotationPointTextItem, QgsAnnotationMarkerItem, and QgsAnnotationLineItem.

◆ zIndex()

int QgsAnnotationItem::zIndex ( ) const
inline

Returns the item's z index, which controls the order in which annotation items are rendered in the layer.

See also
setZIndex()

Definition at line 121 of file qgsannotationitem.h.


The documentation for this class was generated from the following file: