QGIS API Documentation  3.20.0-Odense (decaadbb31)
Public Member Functions | Static Public Member Functions | List of all members
QgsAnnotationLineItem Class Reference

An annotation item which renders a line symbol along a line geometry. More...

#include <qgsannotationlineitem.h>

Inheritance diagram for QgsAnnotationLineItem:
Inheritance graph
[legend]

Public Member Functions

 QgsAnnotationLineItem (QgsCurve *curve)
 Constructor for QgsAnnotationLineItem, with the specified linestring. More...
 
 ~QgsAnnotationLineItem () override
 
QgsRectangle boundingBox () const override
 Returns the bounding box of the item's geographic location, in the parent layer's coordinate reference system. More...
 
QgsAnnotationLineItemclone () override
 Returns a clone of the item. More...
 
const QgsCurvegeometry () const
 Returns the geometry of the item. 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 (QgsCurve *geometry)
 Sets the geometry of the item. More...
 
void setSymbol (QgsLineSymbol *symbol)
 Sets the symbol used to render the marker item. More...
 
const QgsLineSymbolsymbol () const
 Returns the symbol used to render the 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 QgsAnnotationLineItemcreate ()
 Creates a new linestring annotation item. More...
 

Detailed Description

An annotation item which renders a line symbol along a line geometry.

Since
QGIS 3.16

Definition at line 33 of file qgsannotationlineitem.h.

Constructor & Destructor Documentation

◆ QgsAnnotationLineItem()

QgsAnnotationLineItem::QgsAnnotationLineItem ( QgsCurve curve)

Constructor for QgsAnnotationLineItem, with the specified linestring.

Definition at line 23 of file qgsannotationlineitem.cpp.

◆ ~QgsAnnotationLineItem()

QgsAnnotationLineItem::~QgsAnnotationLineItem ( )
overridedefault

Member Function Documentation

◆ boundingBox()

QgsRectangle QgsAnnotationLineItem::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 104 of file qgsannotationlineitem.cpp.

◆ clone()

QgsAnnotationLineItem * QgsAnnotationLineItem::clone ( )
overridevirtual

Returns a clone of the item.

Ownership is transferred to the caller.

Implements QgsAnnotationItem.

Definition at line 109 of file qgsannotationlineitem.cpp.

◆ create()

QgsAnnotationLineItem * QgsAnnotationLineItem::create ( )
static

Creates a new linestring annotation item.

Definition at line 83 of file qgsannotationlineitem.cpp.

◆ geometry()

const QgsCurve* QgsAnnotationLineItem::geometry ( ) const
inline

Returns the geometry of the item.

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

See also
setGeometry()

Definition at line 64 of file qgsannotationlineitem.h.

◆ readXml()

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

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

Implements QgsAnnotationItem.

Definition at line 88 of file qgsannotationlineitem.cpp.

◆ render()

void QgsAnnotationLineItem::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 38 of file qgsannotationlineitem.cpp.

◆ setGeometry()

void QgsAnnotationLineItem::setGeometry ( QgsCurve geometry)
inline

Sets the geometry of the item.

Ownership of geometry is transferred.

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

See also
geometry()

Definition at line 73 of file qgsannotationlineitem.h.

◆ setSymbol()

void QgsAnnotationLineItem::setSymbol ( QgsLineSymbol symbol)

Sets the symbol used to render the marker item.

The item takes ownership of the symbol.

See also
symbol()

Definition at line 122 of file qgsannotationlineitem.cpp.

◆ symbol()

const QgsLineSymbol * QgsAnnotationLineItem::symbol ( ) const

Returns the symbol used to render the item.

See also
setSymbol()

Definition at line 117 of file qgsannotationlineitem.cpp.

◆ type()

QString QgsAnnotationLineItem::type ( ) const
overridevirtual

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

Implements QgsAnnotationItem.

Definition at line 33 of file qgsannotationlineitem.cpp.

◆ writeXml()

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

Writes the item's state into an XML element.

Implements QgsAnnotationItem.

Definition at line 73 of file qgsannotationlineitem.cpp.


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