QGIS API Documentation
3.24.2-Tisler (13c1a02865)
|
An annotation item which renders a text string at a point location. More...
#include <qgsannotationpointtextitem.h>
Public Member Functions | |
QgsAnnotationPointTextItem (const QString &text, QgsPointXY point) | |
Constructor for QgsAnnotationPointTextItem, containing the specified text at the specified point. More... | |
~QgsAnnotationPointTextItem () override | |
Qt::Alignment | alignment () const |
Returns the text's alignment relative to the reference point(). More... | |
double | angle () const |
Returns the text's rotation angle, in degrees clockwise. More... | |
Qgis::AnnotationItemEditOperationResult | applyEdit (QgsAbstractAnnotationItemEditOperation *operation) override |
Applies an edit operation to the item. More... | |
QgsRectangle | boundingBox () const override |
Returns the bounding box of the item's geographic location, in the parent layer's coordinate reference system. More... | |
QgsRectangle | boundingBox (QgsRenderContext &context) const override |
Returns the bounding box of the item's geographic location, in the parent layer's coordinate reference system. More... | |
QgsAnnotationPointTextItem * | clone () override |
Returns a clone of the item. More... | |
Qgis::AnnotationItemFlags | flags () const override |
Returns item flags. More... | |
QgsTextFormat | format () const |
Returns the text format used to render the text. More... | |
QList< QgsAnnotationItemNode > | nodes () const override |
Returns the nodes for the item, used for editing the item. More... | |
QgsPointXY | point () const |
Returns the point location of the text. 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 | setAlignment (Qt::Alignment alignment) |
Sets the text's alignment relative to the reference point(). More... | |
void | setAngle (double angle) |
Sets the text's rotation angle, in degrees clockwise. More... | |
void | setFormat (const QgsTextFormat &format) |
Sets the text format used to render the text. More... | |
void | setPoint (QgsPointXY point) |
Sets the point location of the text. More... | |
void | setText (const QString &text) |
Sets the text rendered by the item. More... | |
QString | text () const |
Returns the text rendered by the item. More... | |
QgsAnnotationItemEditOperationTransientResults * | transientEditResults (QgsAbstractAnnotationItemEditOperation *operation) override |
Retrieves the results of a transient (in progress) edit operation on 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 |
QgsAnnotationItem & | operator= (const QgsAnnotationItem &other)=delete |
QgsAnnotationItem cannot be copied. More... | |
void | setSymbologyReferenceScale (double scale) |
Sets the annotation's symbology reference scale. More... | |
void | setUseSymbologyReferenceScale (bool enabled) |
Sets whether the annotation item uses a symbology reference scale. 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... | |
double | symbologyReferenceScale () const |
Returns the annotation's symbology reference scale. More... | |
bool | useSymbologyReferenceScale () const |
Returns true if the annotation item uses a symbology reference scale. 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 QgsAnnotationPointTextItem * | create () |
Creates a new text at point annotation item. More... | |
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. More... | |
bool | readCommonProperties (const QDomElement &element, const QgsReadWriteContext &context) |
Reads common properties from the base class from the given DOM element. More... | |
bool | writeCommonProperties (QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const |
Writes common properties from the base class into an XML element. More... | |
An annotation item which renders a text string at a point location.
Definition at line 33 of file qgsannotationpointtextitem.h.
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.
|
overridedefault |
Qt::Alignment QgsAnnotationPointTextItem::alignment | ( | ) | const |
Returns the text's alignment relative to the reference point().
Definition at line 209 of file qgsannotationpointtextitem.cpp.
|
inline |
Returns the text's rotation angle, in degrees clockwise.
Definition at line 112 of file qgsannotationpointtextitem.h.
|
overridevirtual |
Applies an edit operation to the item.
Reimplemented from QgsAnnotationItem.
Definition at line 145 of file qgsannotationpointtextitem.cpp.
|
overridevirtual |
Returns the bounding box of the item's geographic location, in the parent layer's coordinate reference system.
Implements QgsAnnotationItem.
Definition at line 119 of file qgsannotationpointtextitem.cpp.
|
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 124 of file qgsannotationpointtextitem.cpp.
|
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.
Implements QgsAnnotationItem.
Definition at line 109 of file qgsannotationpointtextitem.cpp.
|
static |
Creates a new text at point annotation item.
Definition at line 83 of file qgsannotationpointtextitem.cpp.
|
overridevirtual |
Returns item flags.
Reimplemented from QgsAnnotationItem.
Definition at line 32 of file qgsannotationpointtextitem.cpp.
QgsTextFormat QgsAnnotationPointTextItem::format | ( | ) | const |
Returns the text format used to render the text.
Definition at line 199 of file qgsannotationpointtextitem.cpp.
|
overridevirtual |
Returns the nodes for the item, used for editing the item.
Reimplemented from QgsAnnotationItem.
Definition at line 140 of file qgsannotationpointtextitem.cpp.
|
inline |
Returns the point location of the text.
The coordinate reference system for the point will be the parent layer's QgsAnnotationLayer::crs().
Definition at line 68 of file qgsannotationpointtextitem.h.
|
overridevirtual |
Reads the item's state from the given DOM element.
Implementations should include a call to readCommonProperties() to read the base class properties.
Implements QgsAnnotationItem.
Definition at line 88 of file qgsannotationpointtextitem.cpp.
|
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.
void QgsAnnotationPointTextItem::setAlignment | ( | Qt::Alignment | alignment | ) |
Sets the text's alignment relative to the reference point().
Definition at line 214 of file qgsannotationpointtextitem.cpp.
|
inline |
Sets the text's rotation angle, in degrees clockwise.
Definition at line 119 of file qgsannotationpointtextitem.h.
void QgsAnnotationPointTextItem::setFormat | ( | const QgsTextFormat & | format | ) |
Sets the text format used to render the text.
Definition at line 204 of file qgsannotationpointtextitem.cpp.
|
inline |
Sets the point location of the text.
The coordinate reference system for the point will be the parent layer's QgsAnnotationLayer::crs().
Definition at line 77 of file qgsannotationpointtextitem.h.
|
inline |
Sets the text rendered by the item.
Definition at line 91 of file qgsannotationpointtextitem.h.
|
inline |
Returns the text rendered by the item.
Definition at line 84 of file qgsannotationpointtextitem.h.
|
overridevirtual |
Retrieves the results of a transient (in progress) edit operation on the item.
Reimplemented from QgsAnnotationItem.
Definition at line 176 of file qgsannotationpointtextitem.cpp.
|
overridevirtual |
Returns a unique (untranslated) string identifying the type of item.
Implements QgsAnnotationItem.
Definition at line 40 of file qgsannotationpointtextitem.cpp.
|
overridevirtual |
Writes the item's state into an XML element.
Implementations should include a call to writeCommonProperties() to store the base class properties.
Implements QgsAnnotationItem.
Definition at line 67 of file qgsannotationpointtextitem.cpp.