SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
AnnotationTextItem Class Reference

Data model for a single styled text annotation. More...

#include <annotationtextitem.h>

Inheritance diagram for AnnotationTextItem:
Collaboration diagram for AnnotationTextItem:

Properties

Identity & content
QString text
 
Position (layer CRS, double precision)

Stored in the owning layer's CRS. The annotation layer reprojects to canvas CRS when populating the scene so the annotation stays pinned to its map location under pan / zoom.

double x
 
double y
 
double rotation
 
Font + fill (text body)
QFont font
 
QColor fillColor
 
Outline (per-glyph stroke around the text shape)
bool outlineEnabled
 
QColor outlineColor
 
double outlineWidth
 
Halo (soft glow behind text for legibility)
bool haloEnabled
 
QColor haloColor
 
double haloRadius
 

Background (rectangular box behind text)

bool backgroundEnabled
 
QColor backgroundFillColor
 
QColor backgroundOutlineColor
 
double backgroundOutlineWidth
 
double backgroundPadding
 
double backgroundCornerRadius
 
 AnnotationTextItem (QObject *parent=nullptr)
 
 ~AnnotationTextItem () override=default
 
QString id () const
 
void setId (const QString &id)
 
QString text () const
 
double x () const
 
double y () const
 
double rotation () const
 
QFont font () const
 
QColor fillColor () const
 
bool outlineEnabled () const
 
QColor outlineColor () const
 
double outlineWidth () const
 
bool haloEnabled () const
 
QColor haloColor () const
 
double haloRadius () const
 
bool backgroundEnabled () const
 
QColor backgroundFillColor () const
 
QColor backgroundOutlineColor () const
 
double backgroundOutlineWidth () const
 
double backgroundPadding () const
 
double backgroundCornerRadius () const
 
QJsonObject toJson () const
 
void fromJson (const QJsonObject &obj)
 
void setText (const QString &t)
 
void setX (double v)
 
void setY (double v)
 
void setPosition (double x, double y)
 
void setRotation (double deg)
 
void setFont (const QFont &f)
 
void setFillColor (const QColor &c)
 
void setOutlineEnabled (bool on)
 
void setOutlineColor (const QColor &c)
 
void setOutlineWidth (double w)
 
void setHaloEnabled (bool on)
 
void setHaloColor (const QColor &c)
 
void setHaloRadius (double r)
 
void setBackgroundEnabled (bool on)
 
void setBackgroundFillColor (const QColor &c)
 
void setBackgroundOutlineColor (const QColor &c)
 
void setBackgroundOutlineWidth (double w)
 
void setBackgroundPadding (double p)
 
void setBackgroundCornerRadius (double r)
 
void textChanged (const QString &)
 
void positionChanged ()
 
void rotationChanged (double)
 
void fontChanged (const QFont &)
 
void fillColorChanged (const QColor &)
 
void outlineEnabledChanged (bool)
 
void outlineColorChanged (const QColor &)
 
void outlineWidthChanged (double)
 
void haloEnabledChanged (bool)
 
void haloColorChanged (const QColor &)
 
void haloRadiusChanged (double)
 
void backgroundEnabledChanged (bool)
 
void backgroundFillColorChanged (const QColor &)
 
void backgroundOutlineColorChanged (const QColor &)
 
void backgroundOutlineWidthChanged (double)
 
void backgroundPaddingChanged (double)
 
void backgroundCornerRadiusChanged (double)
 
void changed ()
 

Detailed Description

Data model for a single styled text annotation.

Style attributes are exposed as Q_PROPERTYs so they can be driven by a QPropertyModel-backed editor. A single aggregate changed() signal fires after each setter, letting the layer's graphics item issue a single update() per edit.

Constructor & Destructor Documentation

◆ AnnotationTextItem()

AnnotationTextItem::AnnotationTextItem ( QObject *  parent = nullptr)
explicit

◆ ~AnnotationTextItem()

AnnotationTextItem::~AnnotationTextItem ( )
overridedefault

Member Function Documentation

◆ backgroundCornerRadius()

double AnnotationTextItem::backgroundCornerRadius ( ) const
inline

◆ backgroundCornerRadiusChanged

void AnnotationTextItem::backgroundCornerRadiusChanged ( double  )
signal
Here is the caller graph for this function:

◆ backgroundEnabled()

bool AnnotationTextItem::backgroundEnabled ( ) const
inline

◆ backgroundEnabledChanged

void AnnotationTextItem::backgroundEnabledChanged ( bool  )
signal
Here is the caller graph for this function:

◆ backgroundFillColor()

QColor AnnotationTextItem::backgroundFillColor ( ) const
inline

◆ backgroundFillColorChanged

void AnnotationTextItem::backgroundFillColorChanged ( const QColor &  )
signal
Here is the caller graph for this function:

◆ backgroundOutlineColor()

QColor AnnotationTextItem::backgroundOutlineColor ( ) const
inline

◆ backgroundOutlineColorChanged

void AnnotationTextItem::backgroundOutlineColorChanged ( const QColor &  )
signal
Here is the caller graph for this function:

◆ backgroundOutlineWidth()

double AnnotationTextItem::backgroundOutlineWidth ( ) const
inline

◆ backgroundOutlineWidthChanged

void AnnotationTextItem::backgroundOutlineWidthChanged ( double  )
signal
Here is the caller graph for this function:

◆ backgroundPadding()

double AnnotationTextItem::backgroundPadding ( ) const
inline

◆ backgroundPaddingChanged

void AnnotationTextItem::backgroundPaddingChanged ( double  )
signal
Here is the caller graph for this function:

◆ changed

void AnnotationTextItem::changed ( )
signal

Aggregate signal — fires once after any setter mutates state. The layer's graphics item connects to this to trigger a single repaint per edit, instead of subscribing to every per-field NOTIFY.

Here is the caller graph for this function:

◆ fillColor()

QColor AnnotationTextItem::fillColor ( ) const
inline

◆ fillColorChanged

void AnnotationTextItem::fillColorChanged ( const QColor &  )
signal
Here is the caller graph for this function:

◆ font()

QFont AnnotationTextItem::font ( ) const
inline

◆ fontChanged

void AnnotationTextItem::fontChanged ( const QFont &  )
signal
Here is the caller graph for this function:

◆ fromJson()

void AnnotationTextItem::fromJson ( const QJsonObject &  obj)

Replace every field from a JSON entry. Missing keys keep current defaults so older saves restore cleanly under additive schema changes. Restores the persisted id (does NOT regenerate).

Here is the call graph for this function:

◆ haloColor()

QColor AnnotationTextItem::haloColor ( ) const
inline

◆ haloColorChanged

void AnnotationTextItem::haloColorChanged ( const QColor &  )
signal
Here is the caller graph for this function:

◆ haloEnabled()

bool AnnotationTextItem::haloEnabled ( ) const
inline

◆ haloEnabledChanged

void AnnotationTextItem::haloEnabledChanged ( bool  )
signal
Here is the caller graph for this function:

◆ haloRadius()

double AnnotationTextItem::haloRadius ( ) const
inline

◆ haloRadiusChanged

void AnnotationTextItem::haloRadiusChanged ( double  )
signal
Here is the caller graph for this function:

◆ id()

QString AnnotationTextItem::id ( ) const
inline

Immutable identifier — used by undo commands to find the right item across redo/undo and by the project serializer for round-tripping.

Here is the caller graph for this function:

◆ outlineColor()

QColor AnnotationTextItem::outlineColor ( ) const
inline

◆ outlineColorChanged

void AnnotationTextItem::outlineColorChanged ( const QColor &  )
signal
Here is the caller graph for this function:

◆ outlineEnabled()

bool AnnotationTextItem::outlineEnabled ( ) const
inline

◆ outlineEnabledChanged

void AnnotationTextItem::outlineEnabledChanged ( bool  )
signal
Here is the caller graph for this function:

◆ outlineWidth()

double AnnotationTextItem::outlineWidth ( ) const
inline

◆ outlineWidthChanged

void AnnotationTextItem::outlineWidthChanged ( double  )
signal
Here is the caller graph for this function:

◆ positionChanged

void AnnotationTextItem::positionChanged ( )
signal
Here is the caller graph for this function:

◆ rotation()

double AnnotationTextItem::rotation ( ) const
inline

◆ rotationChanged

void AnnotationTextItem::rotationChanged ( double  )
signal
Here is the caller graph for this function:

◆ setBackgroundCornerRadius

void AnnotationTextItem::setBackgroundCornerRadius ( double  r)
slot
Here is the call graph for this function:

◆ setBackgroundEnabled

void AnnotationTextItem::setBackgroundEnabled ( bool  on)
slot
Here is the call graph for this function:

◆ setBackgroundFillColor

void AnnotationTextItem::setBackgroundFillColor ( const QColor &  c)
slot
Here is the call graph for this function:

◆ setBackgroundOutlineColor

void AnnotationTextItem::setBackgroundOutlineColor ( const QColor &  c)
slot
Here is the call graph for this function:

◆ setBackgroundOutlineWidth

void AnnotationTextItem::setBackgroundOutlineWidth ( double  w)
slot
Here is the call graph for this function:

◆ setBackgroundPadding

void AnnotationTextItem::setBackgroundPadding ( double  p)
slot
Here is the call graph for this function:

◆ setFillColor

void AnnotationTextItem::setFillColor ( const QColor &  c)
slot
Here is the call graph for this function:

◆ setFont

void AnnotationTextItem::setFont ( const QFont &  f)
slot
Here is the call graph for this function:

◆ setHaloColor

void AnnotationTextItem::setHaloColor ( const QColor &  c)
slot
Here is the call graph for this function:

◆ setHaloEnabled

void AnnotationTextItem::setHaloEnabled ( bool  on)
slot
Here is the call graph for this function:

◆ setHaloRadius

void AnnotationTextItem::setHaloRadius ( double  r)
slot
Here is the call graph for this function:

◆ setId()

void AnnotationTextItem::setId ( const QString &  id)
inline

Mostly used by load-from-JSON to preserve identifiers across saves.

Here is the call graph for this function:

◆ setOutlineColor

void AnnotationTextItem::setOutlineColor ( const QColor &  c)
slot
Here is the call graph for this function:

◆ setOutlineEnabled

void AnnotationTextItem::setOutlineEnabled ( bool  on)
slot
Here is the call graph for this function:

◆ setOutlineWidth

void AnnotationTextItem::setOutlineWidth ( double  w)
slot
Here is the call graph for this function:

◆ setPosition

void AnnotationTextItem::setPosition ( double  x,
double  y 
)
slot
Here is the call graph for this function:

◆ setRotation

void AnnotationTextItem::setRotation ( double  deg)
slot
Here is the call graph for this function:

◆ setText

void AnnotationTextItem::setText ( const QString &  t)
slot
Here is the call graph for this function:

◆ setX

void AnnotationTextItem::setX ( double  v)
slot
Here is the call graph for this function:

◆ setY

void AnnotationTextItem::setY ( double  v)
slot
Here is the call graph for this function:

◆ text()

QString AnnotationTextItem::text ( ) const
inline

◆ textChanged

void AnnotationTextItem::textChanged ( const QString &  )
signal
Here is the caller graph for this function:

◆ toJson()

QJsonObject AnnotationTextItem::toJson ( ) const

Serialize to a project-file JSON entry.

◆ x()

double AnnotationTextItem::x ( ) const
inline

◆ y()

double AnnotationTextItem::y ( ) const
inline

Property Documentation

◆ backgroundCornerRadius

double AnnotationTextItem::backgroundCornerRadius
readwrite

◆ backgroundEnabled

bool AnnotationTextItem::backgroundEnabled
readwrite

◆ backgroundFillColor

QColor AnnotationTextItem::backgroundFillColor
readwrite

◆ backgroundOutlineColor

QColor AnnotationTextItem::backgroundOutlineColor
readwrite

◆ backgroundOutlineWidth

double AnnotationTextItem::backgroundOutlineWidth
readwrite

◆ backgroundPadding

double AnnotationTextItem::backgroundPadding
readwrite

◆ fillColor

QColor AnnotationTextItem::fillColor
readwrite

◆ font

QFont AnnotationTextItem::font
readwrite

◆ haloColor

QColor AnnotationTextItem::haloColor
readwrite

◆ haloEnabled

bool AnnotationTextItem::haloEnabled
readwrite

◆ haloRadius

double AnnotationTextItem::haloRadius
readwrite

◆ outlineColor

QColor AnnotationTextItem::outlineColor
readwrite

◆ outlineEnabled

bool AnnotationTextItem::outlineEnabled
readwrite

◆ outlineWidth

double AnnotationTextItem::outlineWidth
readwrite

◆ rotation

double AnnotationTextItem::rotation
readwrite

◆ text

QString AnnotationTextItem::text
readwrite

◆ x

double AnnotationTextItem::x
readwrite

◆ y

double AnnotationTextItem::y
readwrite

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