15 #ifndef QGSTEXTLABELFEATURE_H
16 #define QGSTEXTLABELFEATURE_H
46 QString
text(
int partId )
const;
The QgsLabelFeature class describes a feature that should be used within the labeling engine.
QSizeF size(double angle=0.0) const
Size of the label (in map units)
GEOSGeometry * geometry() const
Gets access to the associated geometry.
Perform transforms between map coordinates and device coordinates.
Stores information relating to individual character formatting.
Represents a document consisting of one or more QgsTextBlock objects.
Class that adds extra information to QgsLabelFeature for text labels.
QgsTextLabelFeature(QgsFeatureId id, GEOSGeometry *geometry, const QSizeF &size)
Construct text label feature.
const QMap< QgsPalLayerSettings::Property, QVariant > & dataDefinedValues() const
Gets data-defined values.
void setDocument(const QgsTextDocument &document)
Sets the document for the label.
QList< QgsTextCharacterFormat > mCharacterFormats
void setDefinedFont(const QFont &f)
Sets font to be used for rendering.
QStringList mClusters
List of graphemes (used for curved labels)
QgsTextDocument document() const
Returns the document for the label.
QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > mDataDefinedValues
Stores attribute values for data defined properties.
QFontMetricsF * mFontMetrics
Metrics of the font for rendering.
QgsTextDocument mDocument
QFont definedFont()
Font to be used for rendering.
~QgsTextLabelFeature() override
Clean up.
void setDataDefinedValues(const QMap< QgsPalLayerSettings::Property, QVariant > &values)
Sets data-defined values.
QgsTextCharacterFormat characterFormat(int partId) const
Returns the character format corresponding to the specified label part.
QFont mDefinedFont
Font for rendering.
QMap< QgsPalLayerSettings::Property, QVariant > mDataDefinedValues
Stores attribute values for data defined properties.
void calculateInfo(bool curvedLabeling, QFontMetricsF *fm, const QgsMapToPixel *xform, double fontScale, double maxinangle, double maxoutangle)
calculate data for info(). setDefinedFont() must have been called already.
QString text(int partId) const
Returns the text component corresponding to a specified label part.
bool hasCharacterFormat(int partId) const
Returns true if the feature contains specific character formatting for the part with matching ID.
QFontMetricsF * labelFontMetrics()
Metrics of the font for rendering.
std::unique_ptr< GEOSGeometry, GeosDeleter > unique_ptr
Scoped GEOS pointer.
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features