QGIS API Documentation 3.30.0-'s-Hertogenbosch (f186b8efe0)
Public Types | Public Member Functions | List of all members
QgsTextMaskSettings Class Reference

Container for settings relating to a selective masking around a text. More...

#include <qgstextmasksettings.h>

Public Types

enum  MaskType { MaskBuffer = 0 }
 Mask shape types. More...
 

Public Member Functions

 QgsTextMaskSettings ()
 
 QgsTextMaskSettings (const QgsTextMaskSettings &other)
 Copy constructor. More...
 
 ~QgsTextMaskSettings ()
 
bool enabled () const
 Returns whether the mask is enabled. More...
 
Qt::PenJoinStyle joinStyle () const
 Returns the buffer join style. More...
 
QList< QgsSymbolLayerReferencemaskedSymbolLayers () const
 Returns a list of references to symbol layers that are masked by this buffer. More...
 
double opacity () const
 Returns the mask's opacity. More...
 
bool operator!= (const QgsTextMaskSettings &other) const
 
QgsTextMaskSettingsoperator= (const QgsTextMaskSettings &other)
 Copy constructor. More...
 
bool operator== (const QgsTextMaskSettings &other) const
 
QgsPaintEffectpaintEffect () const
 Returns the current paint effect for the mask. More...
 
void readXml (const QDomElement &elem)
 Read settings from a DOM element. More...
 
QSet< QString > referencedFields (const QgsRenderContext &context) const
 Returns all field names referenced by the configuration (e.g. More...
 
void setEnabled (bool)
 Returns whether the mask is enabled. More...
 
void setJoinStyle (Qt::PenJoinStyle style)
 Sets the join style used for drawing the buffer. More...
 
void setMaskedSymbolLayers (const QList< QgsSymbolLayerReference > &maskedLayers)
 Sets the symbol layers that will be masked by this buffer. More...
 
void setOpacity (double opacity)
 Sets the mask's opacity. More...
 
void setPaintEffect (QgsPaintEffect *effect)
 Sets the current paint effect for the mask. More...
 
void setSize (double size)
 Sets the size of the buffer. More...
 
void setSizeMapUnitScale (const QgsMapUnitScale &scale)
 Sets the map unit scale object for the buffer size. More...
 
void setSizeUnit (Qgis::RenderUnit unit)
 Sets the units used for the buffer size. More...
 
void setType (MaskType type)
 Sets the type of mask shape. More...
 
double size () const
 Returns the size of the buffer. More...
 
QgsMapUnitScale sizeMapUnitScale () const
 Returns the map unit scale object for the buffer size. More...
 
Qgis::RenderUnit sizeUnit () const
 Returns the units for the buffer size. More...
 
MaskType type () const
 Returns the type of mask shape. More...
 
void updateDataDefinedProperties (QgsRenderContext &context, const QgsPropertyCollection &properties)
 Updates the format by evaluating current values of data defined properties. More...
 
QDomElement writeXml (QDomDocument &doc) const
 Write settings into a DOM element. More...
 

Detailed Description

Container for settings relating to a selective masking around a text.

A selective masking only makes sense in contexts where the text is rendered over some other map layers, especially for labeling.

Note
QgsTextMaskSettings objects are implicitly shared.
Since
QGIS 3.12

Definition at line 41 of file qgstextmasksettings.h.

Member Enumeration Documentation

◆ MaskType

Mask shape types.

Enumerator
MaskBuffer 

Buffer.

Definition at line 48 of file qgstextmasksettings.h.

Constructor & Destructor Documentation

◆ QgsTextMaskSettings() [1/2]

QgsTextMaskSettings::QgsTextMaskSettings ( )

Definition at line 24 of file qgstextmasksettings.cpp.

◆ QgsTextMaskSettings() [2/2]

QgsTextMaskSettings::QgsTextMaskSettings ( const QgsTextMaskSettings other)

Copy constructor.

Parameters
othersource settings

Definition at line 31 of file qgstextmasksettings.cpp.

◆ ~QgsTextMaskSettings()

QgsTextMaskSettings::~QgsTextMaskSettings ( )
default

Member Function Documentation

◆ enabled()

bool QgsTextMaskSettings::enabled ( ) const

Returns whether the mask is enabled.

Definition at line 66 of file qgstextmasksettings.cpp.

◆ joinStyle()

Qt::PenJoinStyle QgsTextMaskSettings::joinStyle ( ) const

Returns the buffer join style.

See also
setJoinStyle

Definition at line 117 of file qgstextmasksettings.cpp.

◆ maskedSymbolLayers()

QList< QgsSymbolLayerReference > QgsTextMaskSettings::maskedSymbolLayers ( ) const

Returns a list of references to symbol layers that are masked by this buffer.

Returns
a list of references to masked symbol layers
See also
setMaskedSymbolLayers()

Definition at line 237 of file qgstextmasksettings.cpp.

◆ opacity()

double QgsTextMaskSettings::opacity ( ) const

Returns the mask's opacity.

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

See also
setOpacity()

Definition at line 127 of file qgstextmasksettings.cpp.

◆ operator!=()

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

Definition at line 61 of file qgstextmasksettings.cpp.

◆ operator=()

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

Copy constructor.

Parameters
othersource QgsTextMaskSettings

Definition at line 36 of file qgstextmasksettings.cpp.

◆ operator==()

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

Definition at line 42 of file qgstextmasksettings.cpp.

◆ paintEffect()

QgsPaintEffect * QgsTextMaskSettings::paintEffect ( ) const

Returns the current paint effect for the mask.

Returns
paint effect
See also
setPaintEffect()

Definition at line 137 of file qgstextmasksettings.cpp.

◆ readXml()

void QgsTextMaskSettings::readXml ( const QDomElement &  elem)

Read settings from a DOM element.

See also
writeXml()

Definition at line 203 of file qgstextmasksettings.cpp.

◆ referencedFields()

QSet< QString > QgsTextMaskSettings::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 198 of file qgstextmasksettings.cpp.

◆ setEnabled()

void QgsTextMaskSettings::setEnabled ( bool  enabled)

Returns whether the mask is enabled.

Definition at line 71 of file qgstextmasksettings.cpp.

◆ setJoinStyle()

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

Sets the join style used for drawing the buffer.

Parameters
stylejoin style
See also
joinStyle()

Definition at line 122 of file qgstextmasksettings.cpp.

◆ setMaskedSymbolLayers()

void QgsTextMaskSettings::setMaskedSymbolLayers ( const QList< QgsSymbolLayerReference > &  maskedLayers)

Sets the symbol layers that will be masked by this buffer.

Parameters
maskedLayerslist of references to symbol layers
See also
setMaskedSymbolLayers()

Definition at line 242 of file qgstextmasksettings.cpp.

◆ setOpacity()

void QgsTextMaskSettings::setOpacity ( double  opacity)

Sets the mask's opacity.

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

Definition at line 132 of file qgstextmasksettings.cpp.

◆ setPaintEffect()

void QgsTextMaskSettings::setPaintEffect ( QgsPaintEffect effect)

Sets the current paint effect for the mask.

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

Definition at line 142 of file qgstextmasksettings.cpp.

◆ setSize()

void QgsTextMaskSettings::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 92 of file qgstextmasksettings.cpp.

◆ setSizeMapUnitScale()

void QgsTextMaskSettings::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 112 of file qgstextmasksettings.cpp.

◆ setSizeUnit()

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

Sets the units used for the buffer size.

Parameters
unitsize unit
See also
setSize()
sizeUnit()

Definition at line 102 of file qgstextmasksettings.cpp.

◆ setType()

void QgsTextMaskSettings::setType ( QgsTextMaskSettings::MaskType  type)

Sets the type of mask shape.

Parameters
typeshape type
See also
type()

Definition at line 81 of file qgstextmasksettings.cpp.

◆ size()

double QgsTextMaskSettings::size ( ) const

Returns the size of the buffer.

See also
sizeUnit()
setSize()

Definition at line 87 of file qgstextmasksettings.cpp.

◆ sizeMapUnitScale()

QgsMapUnitScale QgsTextMaskSettings::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 107 of file qgstextmasksettings.cpp.

◆ sizeUnit()

Qgis::RenderUnit QgsTextMaskSettings::sizeUnit ( ) const

Returns the units for the buffer size.

See also
size()
setSizeUnit()

Definition at line 97 of file qgstextmasksettings.cpp.

◆ type()

QgsTextMaskSettings::MaskType QgsTextMaskSettings::type ( ) const

Returns the type of mask shape.

See also
setType()

Definition at line 76 of file qgstextmasksettings.cpp.

◆ updateDataDefinedProperties()

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

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

Definition at line 147 of file qgstextmasksettings.cpp.

◆ writeXml()

QDomElement QgsTextMaskSettings::writeXml ( QDomDocument &  doc) const

Write settings into a DOM element.

See also
readXml()

Definition at line 221 of file qgstextmasksettings.cpp.


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