QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
15 #ifndef QGSTEXTLABELFEATURE_H
16 #define QGSTEXTLABELFEATURE_H
49 QString text(
int partId )
const;
66 bool hasCharacterFormat(
int partId )
const;
69 const QMap< QgsPalLayerSettings::Property, QVariant > &
dataDefinedValues()
const {
return mDataDefinedValues; }
71 void setDataDefinedValues(
const QMap< QgsPalLayerSettings::Property, QVariant > &values ) { mDataDefinedValues = values; }
83 QFontMetricsF *
labelFontMetrics() {
return mFontMetrics.has_value() ? &mFontMetrics.value() :
nullptr; }
88 void setFontMetrics(
const QFontMetricsF &metrics );
114 double wordSpacing,
const QString &text = QString(),
QgsTextDocument *document =
nullptr );
175 double mMaximumCharacterAngleInside = 0;
176 double mMaximumCharacterAngleOutside = 0;
182 #endif //QGSTEXTLABELFEATURE_H
const QMap< QgsPalLayerSettings::Property, QVariant > & dataDefinedValues() const
Gets data-defined values.
double maximumCharacterAngleOutside() const
Returns the maximum angle (in radians) between outside curved label characters.
const QgsPrecalculatedTextMetrics * textMetrics() const
Returns additional info required for curved label placement.
QFontMetricsF * labelFontMetrics()
Metrics of the font for rendering.
void setTextMetrics(const QgsPrecalculatedTextMetrics &metrics)
Sets additional text metrics required for curved label placement.
QFont mDefinedFont
Font for rendering.
Stores information relating to individual character formatting.
std::optional< QFontMetricsF > mFontMetrics
Metrics of the font for rendering.
Class that adds extra information to QgsLabelFeature for text labels.
std::unique_ptr< GEOSGeometry, GeosDeleter > unique_ptr
Scoped GEOS pointer.
double maximumCharacterAngleInside() const
Returns the maximum angle (in radians) between inside curved label characters.
QgsTextDocument mDocument
void setDefinedFont(const QFont &f)
Sets font to be used for rendering.
QFont definedFont() const
Font to be used for rendering.
void setMaximumCharacterAngleOutside(double angle)
Sets the maximum angle (in radians) between outside curved label characters.
Perform transforms between map coordinates and device coordinates.
Represents a document consisting of one or more QgsTextBlock objects.
std::optional< QgsPrecalculatedTextMetrics > mTextMetrics
Contains precalculated properties regarding text metrics for text to be renderered at a later stage.
void setDataDefinedValues(const QMap< QgsPalLayerSettings::Property, QVariant > &values)
Sets data-defined values.
The QgsLabelFeature class describes a feature that should be used within the labeling engine....
void setMaximumCharacterAngleInside(double angle)
Sets the maximum angle (in radians) between inside curved label characters.
double ANALYSIS_EXPORT angle(QgsPoint *p1, QgsPoint *p2, QgsPoint *p3, QgsPoint *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)
QMap< QgsPalLayerSettings::Property, QVariant > mDataDefinedValues
Stores attribute values for data defined properties.
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features