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

An annotation item which renders a marker symbol at a point location. More...

#include <qgsannotationmarkeritem.h>

Inheritance diagram for QgsAnnotationMarkerItem:
Inheritance graph
[legend]

Public Member Functions

 QgsAnnotationMarkerItem (const QgsPoint &point)
 Constructor for QgsAnnotationMarkerItem, at the specified point. More...
 
 ~QgsAnnotationMarkerItem () override
 
QgsRectangle boundingBox () const override
 Returns the bounding box of the item's geographic location, in the parent layer's coordinate reference system. More...
 
QgsAnnotationMarkerItemclone () override
 Returns a clone of the item. More...
 
QgsPointXY geometry () const
 Returns the point geometry of the marker. More...
 
bool readXml (const QDomElement &element, const QgsReadWriteContext &context) override
 Reads the item's state from the given DOM element. More...
 
void render (QgsRenderContext &context, QgsFeedback *feedback) override
 Renders the item to the specified render context. More...
 
void setGeometry (const QgsPoint &geometry)
 Sets the point geometry location of the marker. More...
 
void setSymbol (QgsMarkerSymbol *symbol)
 Sets the symbol used to render the marker item. More...
 
const QgsMarkerSymbolsymbol () const
 Returns the symbol used to render the marker item. More...
 
QString type () const override
 Returns a unique (untranslated) string identifying the type of item. More...
 
bool writeXml (QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const override
 Writes the item's state into an XML element. More...
 
- Public Member Functions inherited from QgsAnnotationItem
 QgsAnnotationItem ()=default
 Constructor for an annotation item. More...
 
 QgsAnnotationItem (const QgsAnnotationItem &other)=delete
 QgsAnnotationItem cannot be copied. More...
 
virtual ~QgsAnnotationItem ()=default
 
QgsAnnotationItemoperator= (const QgsAnnotationItem &other)=delete
 QgsAnnotationItem cannot be copied. 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...
 
int zIndex () const
 Returns the item's z index, which controls the order in which annotation items are rendered in the layer. More...
 

Static Public Member Functions

static QgsAnnotationMarkerItemcreate ()
 Creates a new marker annotation item. More...
 

Detailed Description

An annotation item which renders a marker symbol at a point location.

Since
QGIS 3.16

Definition at line 32 of file qgsannotationmarkeritem.h.

Constructor & Destructor Documentation

◆ QgsAnnotationMarkerItem()

QgsAnnotationMarkerItem::QgsAnnotationMarkerItem ( const QgsPoint point)

Constructor for QgsAnnotationMarkerItem, at the specified point.

Definition at line 22 of file qgsannotationmarkeritem.cpp.

◆ ~QgsAnnotationMarkerItem()

QgsAnnotationMarkerItem::~QgsAnnotationMarkerItem ( )
overridedefault

Member Function Documentation

◆ boundingBox()

QgsRectangle QgsAnnotationMarkerItem::boundingBox ( ) const
overridevirtual

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

Implements QgsAnnotationItem.

Definition at line 97 of file qgsannotationmarkeritem.cpp.

◆ clone()

QgsAnnotationMarkerItem * QgsAnnotationMarkerItem::clone ( )
overridevirtual

Returns a clone of the item.

Ownership is transferred to the caller.

Implements QgsAnnotationItem.

Definition at line 89 of file qgsannotationmarkeritem.cpp.

◆ create()

QgsAnnotationMarkerItem * QgsAnnotationMarkerItem::create ( )
static

Creates a new marker annotation item.

Definition at line 69 of file qgsannotationmarkeritem.cpp.

◆ geometry()

QgsPointXY QgsAnnotationMarkerItem::geometry ( ) const
inline

Returns the point geometry of the marker.

The coordinate reference system for the point will be the parent layer's QgsAnnotationLayer::crs().

See also
setGeometry()

Definition at line 62 of file qgsannotationmarkeritem.h.

◆ readXml()

bool QgsAnnotationMarkerItem::readXml ( const QDomElement &  element,
const QgsReadWriteContext context 
)
overridevirtual

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

Implements QgsAnnotationItem.

Definition at line 74 of file qgsannotationmarkeritem.cpp.

◆ render()

void QgsAnnotationMarkerItem::render ( QgsRenderContext context,
QgsFeedback feedback 
)
overridevirtual

Renders the item to the specified render context.

The feedback argument can be used to detect render cancellations during expensive render operations.

Implements QgsAnnotationItem.

Definition at line 37 of file qgsannotationmarkeritem.cpp.

◆ setGeometry()

void QgsAnnotationMarkerItem::setGeometry ( const QgsPoint geometry)
inline

Sets the point geometry location of the marker.

The coordinate reference system for the point will be the parent layer's QgsAnnotationLayer::crs().

See also
geometry()

Definition at line 71 of file qgsannotationmarkeritem.h.

◆ setSymbol()

void QgsAnnotationMarkerItem::setSymbol ( QgsMarkerSymbol symbol)

Sets the symbol used to render the marker item.

The item takes ownership of the symbol.

See also
symbol()

Definition at line 107 of file qgsannotationmarkeritem.cpp.

◆ symbol()

const QgsMarkerSymbol * QgsAnnotationMarkerItem::symbol ( ) const

Returns the symbol used to render the marker item.

See also
setSymbol()

Definition at line 102 of file qgsannotationmarkeritem.cpp.

◆ type()

QString QgsAnnotationMarkerItem::type ( ) const
overridevirtual

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

Implements QgsAnnotationItem.

Definition at line 32 of file qgsannotationmarkeritem.cpp.

◆ writeXml()

bool QgsAnnotationMarkerItem::writeXml ( QDomElement &  element,
QDomDocument &  document,
const QgsReadWriteContext context 
) const
overridevirtual

Writes the item's state into an XML element.

Implements QgsAnnotationItem.

Definition at line 58 of file qgsannotationmarkeritem.cpp.


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