QGIS API Documentation 3.41.0-Master (45a0abf3bec)
|
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. | |
~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 | applyEditV2 (QgsAbstractAnnotationItemEditOperation *operation, const QgsAnnotationItemEditContext &context) 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. | |
QgsAnnotationPointTextItem * | clone () 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< QgsAnnotationItemNode > | nodesV2 (const QgsAnnotationItemEditContext &context) 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. | |
QgsAnnotationItemEditOperationTransientResults * | transientEditResultsV2 (QgsAbstractAnnotationItemEditOperation *operation, const QgsAnnotationItemEditContext &context) 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 () | |
QgsAnnotationItem (const QgsAnnotationItem &other)=delete | |
virtual | ~QgsAnnotationItem () |
virtual Q_DECL_DEPRECATED Qgis::AnnotationItemEditOperationResult | applyEdit (QgsAbstractAnnotationItemEditOperation *operation) |
Applies an edit operation to the item. | |
QgsCallout * | callout () const |
Returns the item's callout renderer, responsible for drawing item callouts. | |
QgsGeometry | calloutAnchor () const |
Returns the callout's anchor geometry. | |
bool | enabled () const |
Returns true if the item is enabled and will be rendered in the layer. | |
virtual Q_DECL_DEPRECATED QList< QgsAnnotationItemNode > | nodes () const |
Returns the nodes for the item, used for editing the item. | |
QSizeF | offsetFromCallout () const |
Returns the (optional) offset of the annotation item from the calloutAnchor(). | |
Qgis::RenderUnit | offsetFromCalloutUnit () const |
Returns the units for the offsetFromCallout(). | |
QgsAnnotationItem & | operator= (const QgsAnnotationItem &other)=delete |
void | setCallout (QgsCallout *callout) |
Sets the item's callout renderer, responsible for drawing item callouts. | |
void | setCalloutAnchor (const QgsGeometry &anchor) |
Sets the callout's anchor geometry. | |
void | setEnabled (bool enabled) |
Sets if the item will be rendered or not in the layer. | |
void | setOffsetFromCallout (const QSizeF &offset) |
Sets the offset of the annotation item from the calloutAnchor(). | |
void | setOffsetFromCalloutUnit (Qgis::RenderUnit unit) |
Sets the unit for the offsetFromCallout(). | |
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. | |
virtual Q_DECL_DEPRECATED QgsAnnotationItemEditOperationTransientResults * | transientEditResults (QgsAbstractAnnotationItemEditOperation *operation) |
Retrieves the results of a transient (in progress) edit operation on the item. | |
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 QgsAnnotationPointTextItem * | create () |
Creates a new text at point annotation item. | |
Additional Inherited Members | |
Protected Member Functions inherited from QgsAnnotationItem | |
virtual void | copyCommonProperties (const QgsAnnotationItem *other) |
Copies common properties from the base class from an other item. | |
virtual bool | readCommonProperties (const QDomElement &element, const QgsReadWriteContext &context) |
Reads common properties from the base class from the given DOM element. | |
void | renderCallout (QgsRenderContext &context, const QRectF &rect, double angle, QgsCallout::QgsCalloutContext &calloutContext, QgsFeedback *feedback) |
Renders the item's callout. | |
virtual bool | writeCommonProperties (QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const |
Writes common properties from the base class into an XML element. | |
An annotation item which renders a text string at a point location.
Definition at line 34 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 26 of file qgsannotationpointtextitem.cpp.
|
overridedefault |
Qt::Alignment QgsAnnotationPointTextItem::alignment | ( | ) | const |
Returns the text's alignment relative to the reference point().
Definition at line 315 of file qgsannotationpointtextitem.cpp.
|
inline |
Returns the text's rotation angle, in degrees clockwise.
Definition at line 113 of file qgsannotationpointtextitem.h.
|
overridevirtual |
Applies an edit operation to the item.
Reimplemented from QgsAnnotationItem.
Definition at line 240 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 148 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 164 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 137 of file qgsannotationpointtextitem.cpp.
|
static |
Creates a new text at point annotation item.
Definition at line 111 of file qgsannotationpointtextitem.cpp.
|
overridevirtual |
Returns item flags.
Reimplemented from QgsAnnotationItem.
Definition at line 34 of file qgsannotationpointtextitem.cpp.
QgsTextFormat QgsAnnotationPointTextItem::format | ( | ) | const |
Returns the text format used to render the text.
Definition at line 305 of file qgsannotationpointtextitem.cpp.
|
overridevirtual |
Returns the nodes for the item, used for editing the item.
Reimplemented from QgsAnnotationItem.
Definition at line 222 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 69 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 116 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 49 of file qgsannotationpointtextitem.cpp.
Qgis::SymbolRotationMode QgsAnnotationPointTextItem::rotationMode | ( | ) | const |
Returns the rotation mode for the text item.
Definition at line 325 of file qgsannotationpointtextitem.cpp.
void QgsAnnotationPointTextItem::setAlignment | ( | Qt::Alignment | alignment | ) |
Sets the text's alignment relative to the reference point().
Definition at line 320 of file qgsannotationpointtextitem.cpp.
|
inline |
Sets the text's rotation angle, in degrees clockwise.
Definition at line 120 of file qgsannotationpointtextitem.h.
void QgsAnnotationPointTextItem::setFormat | ( | const QgsTextFormat & | format | ) |
Sets the text format used to render the text.
Definition at line 310 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 78 of file qgsannotationpointtextitem.h.
void QgsAnnotationPointTextItem::setRotationMode | ( | Qgis::SymbolRotationMode | mode | ) |
Sets the rotation mode for the text item.
Definition at line 330 of file qgsannotationpointtextitem.cpp.
|
inline |
Sets the text rendered by the item.
Definition at line 92 of file qgsannotationpointtextitem.h.
|
inline |
Returns the text rendered by the item.
Definition at line 85 of file qgsannotationpointtextitem.h.
|
overridevirtual |
Retrieves the results of a transient (in progress) edit operation on the item.
Reimplemented from QgsAnnotationItem.
Definition at line 282 of file qgsannotationpointtextitem.cpp.
|
overridevirtual |
Returns a unique (untranslated) string identifying the type of item.
Implements QgsAnnotationItem.
Definition at line 44 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 94 of file qgsannotationpointtextitem.cpp.