QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QgsTextBufferSettings Class Reference

Container for settings relating to a text buffer. More...

#include <qgstextbuffersettings.h>

Public Member Functions

 QgsTextBufferSettings ()
 
 QgsTextBufferSettings (const QgsTextBufferSettings &other)
 Copy constructor.
 
 ~QgsTextBufferSettings ()
 
QPainter::CompositionMode blendMode () const
 Returns the blending mode used for drawing the buffer.
 
QColor color () const
 Returns the color of the buffer.
 
bool enabled () const
 Returns whether the buffer is enabled.
 
bool fillBufferInterior () const
 Returns whether the interior of the buffer will be filled in.
 
Qt::PenJoinStyle joinStyle () const
 Returns the buffer join style.
 
double opacity () const
 Returns the buffer opacity.
 
bool operator!= (const QgsTextBufferSettings &other) const
 
QgsTextBufferSettingsoperator= (const QgsTextBufferSettings &other)
 Copy constructor.
 
bool operator== (const QgsTextBufferSettings &other) const
 
const QgsPaintEffectpaintEffect () const
 Returns the current paint effect for the buffer.
 
void readFromLayer (QgsVectorLayer *layer)
 Reads settings from a layer's custom properties (for QGIS 2.x projects).
 
void readXml (const QDomElement &elem)
 Read settings from a DOM element.
 
QSet< QString > referencedFields (const QgsRenderContext &context) const
 Returns all field names referenced by the configuration (e.g.
 
void setBlendMode (QPainter::CompositionMode mode)
 Sets the blending mode used for drawing the buffer.
 
void setColor (const QColor &color)
 Sets the color for the buffer.
 
void setEnabled (bool enabled)
 Sets whether the text buffer will be drawn.
 
void setFillBufferInterior (bool fill)
 Sets whether the interior of the buffer will be filled in.
 
void setJoinStyle (Qt::PenJoinStyle style)
 Sets the join style used for drawing the buffer.
 
void setOpacity (double opacity)
 Sets the buffer opacity.
 
void setPaintEffect (QgsPaintEffect *effect)
 Sets the current paint effect for the buffer.
 
void setSize (double size)
 Sets the size of the buffer.
 
void setSizeMapUnitScale (const QgsMapUnitScale &scale)
 Sets the map unit scale object for the buffer size.
 
void setSizeUnit (Qgis::RenderUnit unit)
 Sets the units used for the buffer size.
 
double size () const
 Returns the size of the buffer.
 
QgsMapUnitScale sizeMapUnitScale () const
 Returns the map unit scale object for the buffer size.
 
Qgis::RenderUnit sizeUnit () const
 Returns the units for the buffer size.
 
void updateDataDefinedProperties (QgsRenderContext &context, const QgsPropertyCollection &properties)
 Updates the format by evaluating current values of data defined properties.
 
QDomElement writeXml (QDomDocument &doc) const
 Write settings into a DOM element.
 

Detailed Description

Container for settings relating to a text buffer.

Note
QgsTextBufferSettings objects are implicitly shared.
Since
QGIS 3.0

Definition at line 42 of file qgstextbuffersettings.h.

Constructor & Destructor Documentation

◆ QgsTextBufferSettings() [1/2]

QgsTextBufferSettings::QgsTextBufferSettings ( )

Definition at line 28 of file qgstextbuffersettings.cpp.

◆ QgsTextBufferSettings() [2/2]

QgsTextBufferSettings::QgsTextBufferSettings ( const QgsTextBufferSettings other)

Copy constructor.

Parameters
othersource settings

Definition at line 33 of file qgstextbuffersettings.cpp.

◆ ~QgsTextBufferSettings()

QgsTextBufferSettings::~QgsTextBufferSettings ( )

Definition at line 44 of file qgstextbuffersettings.cpp.

Member Function Documentation

◆ blendMode()

QPainter::CompositionMode QgsTextBufferSettings::blendMode ( ) const

Returns the blending mode used for drawing the buffer.

See also
setBlendMode()

Definition at line 154 of file qgstextbuffersettings.cpp.

◆ color()

QColor QgsTextBufferSettings::color ( ) const

Returns the color of the buffer.

See also
setColor()

Definition at line 114 of file qgstextbuffersettings.cpp.

◆ enabled()

bool QgsTextBufferSettings::enabled ( ) const

Returns whether the buffer is enabled.

See also
setEnabled()

Definition at line 74 of file qgstextbuffersettings.cpp.

◆ fillBufferInterior()

bool QgsTextBufferSettings::fillBufferInterior ( ) const

Returns whether the interior of the buffer will be filled in.

If false, only the stroke of the text will be drawn as the buffer. The effect of this setting is only visible for semi-transparent text.

See also
setFillBufferInterior()

Definition at line 124 of file qgstextbuffersettings.cpp.

◆ joinStyle()

Qt::PenJoinStyle QgsTextBufferSettings::joinStyle ( ) const

Returns the buffer join style.

See also
setJoinStyle

Definition at line 144 of file qgstextbuffersettings.cpp.

◆ opacity()

double QgsTextBufferSettings::opacity ( ) const

Returns the buffer opacity.

The opacity is a double value between 0 (fully transparent) and 1 (totally opaque).

See also
setOpacity()

Definition at line 134 of file qgstextbuffersettings.cpp.

◆ operator!=()

bool QgsTextBufferSettings::operator!= ( const QgsTextBufferSettings other) const

Definition at line 69 of file qgstextbuffersettings.cpp.

◆ operator=()

QgsTextBufferSettings & QgsTextBufferSettings::operator= ( const QgsTextBufferSettings other)

Copy constructor.

Parameters
othersource QgsTextBufferSettings

Definition at line 38 of file qgstextbuffersettings.cpp.

◆ operator==()

bool QgsTextBufferSettings::operator== ( const QgsTextBufferSettings other) const

Definition at line 49 of file qgstextbuffersettings.cpp.

◆ paintEffect()

const QgsPaintEffect * QgsTextBufferSettings::paintEffect ( ) const

Returns the current paint effect for the buffer.

Returns
paint effect
See also
setPaintEffect()

Definition at line 164 of file qgstextbuffersettings.cpp.

◆ readFromLayer()

void QgsTextBufferSettings::readFromLayer ( QgsVectorLayer layer)

Reads settings from a layer's custom properties (for QGIS 2.x projects).

Parameters
layersource vector layer

Definition at line 241 of file qgstextbuffersettings.cpp.

◆ readXml()

void QgsTextBufferSettings::readXml ( const QDomElement &  elem)

Read settings from a DOM element.

See also
writeXml()

Definition at line 312 of file qgstextbuffersettings.cpp.

◆ referencedFields()

QSet< QString > QgsTextBufferSettings::referencedFields ( const QgsRenderContext context) const

Returns all field names referenced by the configuration (e.g.

from data defined properties).

Since
QGIS 3.14

Definition at line 236 of file qgstextbuffersettings.cpp.

◆ setBlendMode()

void QgsTextBufferSettings::setBlendMode ( QPainter::CompositionMode  mode)

Sets the blending mode used for drawing the buffer.

Parameters
modeblending mode
See also
blendMode()

Definition at line 159 of file qgstextbuffersettings.cpp.

◆ setColor()

void QgsTextBufferSettings::setColor ( const QColor &  color)

Sets the color for the buffer.

Parameters
colorbuffer color
See also
color()

Definition at line 119 of file qgstextbuffersettings.cpp.

◆ setEnabled()

void QgsTextBufferSettings::setEnabled ( bool  enabled)

Sets whether the text buffer will be drawn.

Parameters
enabledset to true to draw buffer
See also
enabled()

Definition at line 79 of file qgstextbuffersettings.cpp.

◆ setFillBufferInterior()

void QgsTextBufferSettings::setFillBufferInterior ( bool  fill)

Sets whether the interior of the buffer will be filled in.

Parameters
fillset to false to drawn only the stroke of the text as the buffer, or true to also shade the area inside the text. The effect of this setting is only visible for semi-transparent text.
See also
fillBufferInterior()

Definition at line 129 of file qgstextbuffersettings.cpp.

◆ setJoinStyle()

void QgsTextBufferSettings::setJoinStyle ( Qt::PenJoinStyle  style)

Sets the join style used for drawing the buffer.

Parameters
stylejoin style
See also
joinStyle()

Definition at line 149 of file qgstextbuffersettings.cpp.

◆ setOpacity()

void QgsTextBufferSettings::setOpacity ( double  opacity)

Sets the buffer opacity.

Parameters
opacityopacity as a double value between 0 (fully transparent) and 1 (totally opaque)
See also
opacity()

Definition at line 139 of file qgstextbuffersettings.cpp.

◆ setPaintEffect()

void QgsTextBufferSettings::setPaintEffect ( QgsPaintEffect effect)

Sets the current paint effect for the buffer.

Parameters
effectpaint effect. Ownership is transferred to the buffer settings.
See also
paintEffect()

Definition at line 169 of file qgstextbuffersettings.cpp.

◆ setSize()

void QgsTextBufferSettings::setSize ( double  size)

Sets the size of the buffer.

The size units are specified using setSizeUnit().

Parameters
sizebuffer size
See also
size()
setSizeUnit()

Definition at line 89 of file qgstextbuffersettings.cpp.

◆ setSizeMapUnitScale()

void QgsTextBufferSettings::setSizeMapUnitScale ( const QgsMapUnitScale scale)

Sets the map unit scale object for the buffer size.

This is only used if the buffer size is set to QgsUnitTypes::RenderMapUnit.

Parameters
scalescale for buffer size
See also
sizeMapUnitScale()
setSizeUnit()

Definition at line 109 of file qgstextbuffersettings.cpp.

◆ setSizeUnit()

void QgsTextBufferSettings::setSizeUnit ( Qgis::RenderUnit  unit)

Sets the units used for the buffer size.

Parameters
unitsize unit
See also
setSize()
sizeUnit()

Definition at line 99 of file qgstextbuffersettings.cpp.

◆ size()

double QgsTextBufferSettings::size ( ) const

Returns the size of the buffer.

See also
sizeUnit()
setSize()

Definition at line 84 of file qgstextbuffersettings.cpp.

◆ sizeMapUnitScale()

QgsMapUnitScale QgsTextBufferSettings::sizeMapUnitScale ( ) const

Returns the map unit scale object for the buffer size.

This is only used if the buffer size is set to QgsUnitTypes::RenderMapUnit.

See also
setSizeMapUnitScale()
sizeUnit()

Definition at line 104 of file qgstextbuffersettings.cpp.

◆ sizeUnit()

Qgis::RenderUnit QgsTextBufferSettings::sizeUnit ( ) const

Returns the units for the buffer size.

See also
size()
setSizeUnit()

Definition at line 94 of file qgstextbuffersettings.cpp.

◆ updateDataDefinedProperties()

void QgsTextBufferSettings::updateDataDefinedProperties ( QgsRenderContext context,
const QgsPropertyCollection properties 
)

Updates the format by evaluating current values of data defined properties.

Since
QGIS 3.10

Definition at line 174 of file qgstextbuffersettings.cpp.

◆ writeXml()

QDomElement QgsTextBufferSettings::writeXml ( QDomDocument &  doc) const

Write settings into a DOM element.

See also
readXml()

Definition at line 379 of file qgstextbuffersettings.cpp.


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