QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
Static Public Member Functions | List of all members
QgsTextRendererUtils Class Reference

Utility functions for text rendering. More...

#include <qgstextrendererutils.h>

Static Public Member Functions

static QgsUnitTypes::RenderUnit convertFromOldLabelUnit (int val)
 Converts a unit from an old (pre 3.0) label unit. More...
 
static QgsTextBackgroundSettings::RotationType decodeBackgroundRotationType (const QString &string)
 Decodes a string representation of a background rotation type to a type. More...
 
static QgsTextBackgroundSettings::SizeType decodeBackgroundSizeType (const QString &string)
 Decodes a string representation of a background size type to a type. More...
 
static QgsTextShadowSettings::ShadowPlacement decodeShadowPlacementType (const QString &string)
 Decodes a string representation of a shadow placement type to a type. More...
 
static QgsTextBackgroundSettings::ShapeType decodeShapeType (const QString &string)
 Decodes a string representation of a background shape type to a type. More...
 
static QgsTextFormat::TextOrientation decodeTextOrientation (const QString &name, bool *ok=nullptr)
 Attempts to decode a string representation of a text orientation. More...
 
static QString encodeTextOrientation (QgsTextFormat::TextOrientation orientation)
 Encodes a text orientation. More...
 
static QColor readColor (QgsVectorLayer *layer, const QString &property, const QColor &defaultColor=Qt::black, bool withAlpha=true)
 Converts an encoded color value from a layer property. More...
 

Detailed Description

Utility functions for text rendering.

Since
QGIS 3.10

Definition at line 31 of file qgstextrendererutils.h.

Member Function Documentation

◆ convertFromOldLabelUnit()

QgsUnitTypes::RenderUnit QgsTextRendererUtils::convertFromOldLabelUnit ( int  val)
static

Converts a unit from an old (pre 3.0) label unit.

Note
Not available in Python bindings.
Since
QGIS 3.14

Definition at line 131 of file qgstextrendererutils.cpp.

◆ decodeBackgroundRotationType()

QgsTextBackgroundSettings::RotationType QgsTextRendererUtils::decodeBackgroundRotationType ( const QString &  string)
static

Decodes a string representation of a background rotation type to a type.

Definition at line 60 of file qgstextrendererutils.cpp.

◆ decodeBackgroundSizeType()

QgsTextBackgroundSettings::SizeType QgsTextRendererUtils::decodeBackgroundSizeType ( const QString &  string)
static

Decodes a string representation of a background size type to a type.

Definition at line 47 of file qgstextrendererutils.cpp.

◆ decodeShadowPlacementType()

QgsTextShadowSettings::ShadowPlacement QgsTextRendererUtils::decodeShadowPlacementType ( const QString &  string)
static

Decodes a string representation of a shadow placement type to a type.

Definition at line 77 of file qgstextrendererutils.cpp.

◆ decodeShapeType()

QgsTextBackgroundSettings::ShapeType QgsTextRendererUtils::decodeShapeType ( const QString &  string)
static

Decodes a string representation of a background shape type to a type.

Definition at line 19 of file qgstextrendererutils.cpp.

◆ decodeTextOrientation()

QgsTextFormat::TextOrientation QgsTextRendererUtils::decodeTextOrientation ( const QString &  name,
bool *  ok = nullptr 
)
static

Attempts to decode a string representation of a text orientation.

Parameters
nameencoded text orientation name
okif specified, will be set to true if the name was successfully decoded
Returns
decoded text orientation
See also
encodeTextOrientation()

Definition at line 112 of file qgstextrendererutils.cpp.

◆ encodeTextOrientation()

QString QgsTextRendererUtils::encodeTextOrientation ( QgsTextFormat::TextOrientation  orientation)
static

Encodes a text orientation.

Returns
encoded string
See also
decodeTextOrientation()

Definition at line 98 of file qgstextrendererutils.cpp.

◆ readColor()

QColor QgsTextRendererUtils::readColor ( QgsVectorLayer layer,
const QString &  property,
const QColor &  defaultColor = Qt::black,
bool  withAlpha = true 
)
static

Converts an encoded color value from a layer property.

Note
Not available in Python bindings.
Since
QGIS 3.14

Definition at line 145 of file qgstextrendererutils.cpp.


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