QGIS API Documentation 3.38.0-Grenoble (exported)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
QgsAnnotationPointTextItem Class Reference

An annotation item which renders a text string at a point location. More...

#include <qgsannotationpointtextitem.h>

Inheritance diagram for QgsAnnotationPointTextItem:
Inheritance graph
[legend]

Public Member Functions

 QgsAnnotationPointTextItem (const QString &text, QgsPointXY point)
 Constructor for QgsAnnotationPointTextItem, containing the specified text at the specified point.
 
 ~QgsAnnotationPointTextItem () override
 
Qt::Alignment alignment () const
 Returns the text's alignment relative to the reference point().
 
double angle () const
 Returns the text's rotation angle, in degrees clockwise.
 
Qgis::AnnotationItemEditOperationResult applyEdit (QgsAbstractAnnotationItemEditOperation *operation) override
 Applies an edit operation to the item.
 
QgsRectangle boundingBox () const override
 Returns the bounding box of the item's geographic location, in the parent layer's coordinate reference system.
 
QgsRectangle boundingBox (QgsRenderContext &context) const override
 Returns the bounding box of the item's geographic location, in the parent layer's coordinate reference system.
 
QgsAnnotationPointTextItemclone () const override
 Returns a clone of the item.
 
Qgis::AnnotationItemFlags flags () const override
 Returns item flags.
 
QgsTextFormat format () const
 Returns the text format used to render the text.
 
QList< QgsAnnotationItemNodenodes () const override
 Returns the nodes for the item, used for editing the item.
 
QgsPointXY point () const
 Returns the point location of the text.
 
bool readXml (const QDomElement &element, const QgsReadWriteContext &context) override
 Reads the item's state from the given DOM element.
 
void render (QgsRenderContext &context, QgsFeedback *feedback) override
 Renders the item to the specified render context.
 
Qgis::SymbolRotationMode rotationMode () const
 Returns the rotation mode for the text item.
 
void setAlignment (Qt::Alignment alignment)
 Sets the text's alignment relative to the reference point().
 
void setAngle (double angle)
 Sets the text's rotation angle, in degrees clockwise.
 
void setFormat (const QgsTextFormat &format)
 Sets the text format used to render the text.
 
void setPoint (QgsPointXY point)
 Sets the point location of the text.
 
void setRotationMode (Qgis::SymbolRotationMode mode)
 Sets the rotation mode for the text item.
 
void setText (const QString &text)
 Sets the text rendered by the item.
 
QString text () const
 Returns the text rendered by the item.
 
QgsAnnotationItemEditOperationTransientResultstransientEditResults (QgsAbstractAnnotationItemEditOperation *operation) override
 Retrieves the results of a transient (in progress) edit operation on the item.
 
QString type () const override
 Returns a unique (untranslated) string identifying the type of item.
 
bool writeXml (QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const override
 Writes the item's state into an XML element.
 
- Public Member Functions inherited from QgsAnnotationItem
 QgsAnnotationItem ()=default
 Constructor for an annotation item.
 
 QgsAnnotationItem (const QgsAnnotationItem &other)=delete
 QgsAnnotationItem cannot be copied.
 
virtual ~QgsAnnotationItem ()=default
 
bool enabled () const
 Returns true if the item is enabled and will be rendered in the layer.
 
QgsAnnotationItemoperator= (const QgsAnnotationItem &other)=delete
 QgsAnnotationItem cannot be copied.
 
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.
 
bool useSymbologyReferenceScale () const
 Returns true if the annotation item uses a symbology reference scale.
 
int zIndex () const
 Returns the item's z index, which controls the order in which annotation items are rendered in the layer.
 

Static Public Member Functions

static QgsAnnotationPointTextItemcreate ()
 Creates a new text at point annotation item.
 

Additional Inherited Members

- Protected Member Functions inherited from QgsAnnotationItem
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.
 

Detailed Description

An annotation item which renders a text string at a point location.

Since
QGIS 3.16

Definition at line 34 of file qgsannotationpointtextitem.h.

Constructor & Destructor Documentation

◆ QgsAnnotationPointTextItem()

QgsAnnotationPointTextItem::QgsAnnotationPointTextItem ( const QString &  text,
QgsPointXY  point 
)

Constructor for QgsAnnotationPointTextItem, containing the specified text at the specified point.

Definition at line 24 of file qgsannotationpointtextitem.cpp.

◆ ~QgsAnnotationPointTextItem()

QgsAnnotationPointTextItem::~QgsAnnotationPointTextItem ( )
overridedefault

Member Function Documentation

◆ alignment()

Qt::Alignment QgsAnnotationPointTextItem::alignment ( ) const

Returns the text's alignment relative to the reference point().

See also
setAlignment().

Definition at line 267 of file qgsannotationpointtextitem.cpp.

◆ angle()

double QgsAnnotationPointTextItem::angle ( ) const
inline

Returns the text's rotation angle, in degrees clockwise.

See also
setAngle()

Definition at line 113 of file qgsannotationpointtextitem.h.

◆ applyEdit()

Qgis::AnnotationItemEditOperationResult QgsAnnotationPointTextItem::applyEdit ( QgsAbstractAnnotationItemEditOperation operation)
overridevirtual

Applies an edit operation to the item.

Since
QGIS 3.22

Reimplemented from QgsAnnotationItem.

Definition at line 203 of file qgsannotationpointtextitem.cpp.

◆ boundingBox() [1/2]

QgsRectangle QgsAnnotationPointTextItem::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 132 of file qgsannotationpointtextitem.cpp.

◆ boundingBox() [2/2]

QgsRectangle QgsAnnotationPointTextItem::boundingBox ( QgsRenderContext context) const
overridevirtual

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

Reimplemented from QgsAnnotationItem.

Definition at line 148 of file qgsannotationpointtextitem.cpp.

◆ clone()

QgsAnnotationPointTextItem * QgsAnnotationPointTextItem::clone ( ) const
overridevirtual

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.

See also
copyCommonProperties()

Implements QgsAnnotationItem.

Definition at line 121 of file qgsannotationpointtextitem.cpp.

◆ create()

QgsAnnotationPointTextItem * QgsAnnotationPointTextItem::create ( )
static

Creates a new text at point annotation item.

Definition at line 95 of file qgsannotationpointtextitem.cpp.

◆ flags()

Qgis::AnnotationItemFlags QgsAnnotationPointTextItem::flags ( ) const
overridevirtual

Returns item flags.

Since
QGIS 3.22

Reimplemented from QgsAnnotationItem.

Definition at line 32 of file qgsannotationpointtextitem.cpp.

◆ format()

QgsTextFormat QgsAnnotationPointTextItem::format ( ) const

Returns the text format used to render the text.

See also
setFormat()

Definition at line 257 of file qgsannotationpointtextitem.cpp.

◆ nodes()

QList< QgsAnnotationItemNode > QgsAnnotationPointTextItem::nodes ( ) const
overridevirtual

Returns the nodes for the item, used for editing the item.

Since
QGIS 3.22

Reimplemented from QgsAnnotationItem.

Definition at line 198 of file qgsannotationpointtextitem.cpp.

◆ point()

QgsPointXY QgsAnnotationPointTextItem::point ( ) const
inline

Returns the point location of the text.

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

See also
setPoint()

Definition at line 69 of file qgsannotationpointtextitem.h.

◆ readXml()

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

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

Implementations should include a call to readCommonProperties() to read the base class properties.

See also
writeXml()
readCommonProperties()

Implements QgsAnnotationItem.

Definition at line 100 of file qgsannotationpointtextitem.cpp.

◆ render()

void QgsAnnotationPointTextItem::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 45 of file qgsannotationpointtextitem.cpp.

◆ rotationMode()

Qgis::SymbolRotationMode QgsAnnotationPointTextItem::rotationMode ( ) const

Returns the rotation mode for the text item.

See also
setRotationMode()
Since
QGIS 3.32

Definition at line 277 of file qgsannotationpointtextitem.cpp.

◆ setAlignment()

void QgsAnnotationPointTextItem::setAlignment ( Qt::Alignment  alignment)

Sets the text's alignment relative to the reference point().

See also
alignment().

Definition at line 272 of file qgsannotationpointtextitem.cpp.

◆ setAngle()

void QgsAnnotationPointTextItem::setAngle ( double  angle)
inline

Sets the text's rotation angle, in degrees clockwise.

See also
angle()

Definition at line 120 of file qgsannotationpointtextitem.h.

◆ setFormat()

void QgsAnnotationPointTextItem::setFormat ( const QgsTextFormat format)

Sets the text format used to render the text.

See also
format()

Definition at line 262 of file qgsannotationpointtextitem.cpp.

◆ setPoint()

void QgsAnnotationPointTextItem::setPoint ( QgsPointXY  point)
inline

Sets the point location of the text.

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

See also
point()

Definition at line 78 of file qgsannotationpointtextitem.h.

◆ setRotationMode()

void QgsAnnotationPointTextItem::setRotationMode ( Qgis::SymbolRotationMode  mode)

Sets the rotation mode for the text item.

See also
rotationMode()
Since
QGIS 3.32

Definition at line 282 of file qgsannotationpointtextitem.cpp.

◆ setText()

void QgsAnnotationPointTextItem::setText ( const QString &  text)
inline

Sets the text rendered by the item.

See also
text()

Definition at line 92 of file qgsannotationpointtextitem.h.

◆ text()

QString QgsAnnotationPointTextItem::text ( ) const
inline

Returns the text rendered by the item.

See also
setText()

Definition at line 85 of file qgsannotationpointtextitem.h.

◆ transientEditResults()

QgsAnnotationItemEditOperationTransientResults * QgsAnnotationPointTextItem::transientEditResults ( QgsAbstractAnnotationItemEditOperation operation)
overridevirtual

Retrieves the results of a transient (in progress) edit operation on the item.

Since
QGIS 3.22

Reimplemented from QgsAnnotationItem.

Definition at line 234 of file qgsannotationpointtextitem.cpp.

◆ type()

QString QgsAnnotationPointTextItem::type ( ) const
overridevirtual

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

Implements QgsAnnotationItem.

Definition at line 40 of file qgsannotationpointtextitem.cpp.

◆ writeXml()

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

Writes the item's state into an XML element.

Implementations should include a call to writeCommonProperties() to store the base class properties.

See also
readXml()
writeCommonProperties()

Implements QgsAnnotationItem.

Definition at line 78 of file qgsannotationpointtextitem.cpp.


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