| QGIS API Documentation 3.30.0-'s-Hertogenbosch (f186b8efe0)
    | 
Container for settings relating to a text shadow. More...
#include <qgstextshadowsettings.h>
| Public Types | |
| enum | ShadowPlacement { ShadowLowest = 0 , ShadowText , ShadowBuffer , ShadowShape } | 
| Placement positions for text shadow.  More... | |
| Public Member Functions | |
| QgsTextShadowSettings () | |
| QgsTextShadowSettings (const QgsTextShadowSettings &other) | |
| Copy constructor.  More... | |
| ~QgsTextShadowSettings () | |
| QPainter::CompositionMode | blendMode () const | 
| Returns the blending mode used for drawing the drop shadow.  More... | |
| bool | blurAlphaOnly () const | 
| Returns whether only the alpha channel for the shadow will be blurred.  More... | |
| double | blurRadius () const | 
| Returns the blur radius for the shadow.  More... | |
| QgsMapUnitScale | blurRadiusMapUnitScale () const | 
| Returns the map unit scale object for the shadow blur radius.  More... | |
| Qgis::RenderUnit | blurRadiusUnit () const | 
| Returns the units used for the shadow's blur radius.  More... | |
| QColor | color () const | 
| Returns the color of the drop shadow.  More... | |
| bool | enabled () const | 
| Returns whether the shadow is enabled.  More... | |
| int | offsetAngle () const | 
| Returns the angle for offsetting the position of the shadow from the text.  More... | |
| double | offsetDistance () const | 
| Returns the distance for offsetting the position of the shadow from the text.  More... | |
| bool | offsetGlobal () const | 
| Returns trueif the global shadow offset will be used.  More... | |
| QgsMapUnitScale | offsetMapUnitScale () const | 
| Returns the map unit scale object for the shadow offset distance.  More... | |
| Qgis::RenderUnit | offsetUnit () const | 
| Returns the units used for the shadow's offset.  More... | |
| double | opacity () const | 
| Returns the shadow's opacity.  More... | |
| bool | operator!= (const QgsTextShadowSettings &other) const | 
| QgsTextShadowSettings & | operator= (const QgsTextShadowSettings &other) | 
| bool | operator== (const QgsTextShadowSettings &other) const | 
| void | readFromLayer (QgsVectorLayer *layer) | 
| Reads settings from a layer's custom properties (for QGIS 2.x projects).  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... | |
| int | scale () const | 
| Returns the scaling used for the drop shadow (in percentage of original size).  More... | |
| void | setBlendMode (QPainter::CompositionMode mode) | 
| Sets the blending mode used for drawing the drop shadow.  More... | |
| void | setBlurAlphaOnly (bool alphaOnly) | 
| Sets whether only the alpha channel for the shadow should be blurred.  More... | |
| void | setBlurRadius (double blurRadius) | 
| Sets the blur radius for the shadow.  More... | |
| void | setBlurRadiusMapUnitScale (const QgsMapUnitScale &scale) | 
| Sets the map unit scale object for the shadow blur radius.  More... | |
| void | setBlurRadiusUnit (Qgis::RenderUnit units) | 
| Sets the units used for the shadow's blur radius.  More... | |
| void | setColor (const QColor &color) | 
| Sets the color for the drop shadow.  More... | |
| void | setEnabled (bool enabled) | 
| Sets whether the text shadow will be drawn.  More... | |
| void | setOffsetAngle (int angle) | 
| Sets the angle for offsetting the position of the shadow from the text.  More... | |
| void | setOffsetDistance (double distance) | 
| Sets the distance for offsetting the position of the shadow from the text.  More... | |
| void | setOffsetGlobal (bool global) | 
| Sets whether the global shadow offset should be used.  More... | |
| void | setOffsetMapUnitScale (const QgsMapUnitScale &scale) | 
| Sets the map unit scale object for the shadow offset distance.  More... | |
| void | setOffsetUnit (Qgis::RenderUnit units) | 
| Sets the units used for the shadow's offset.  More... | |
| void | setOpacity (double opacity) | 
| Sets the shadow's opacity.  More... | |
| void | setScale (int scale) | 
| Sets the scaling used for the drop shadow (in percentage of original size).  More... | |
| void | setShadowPlacement (QgsTextShadowSettings::ShadowPlacement placement) | 
| Sets the placement for the drop shadow.  More... | |
| QgsTextShadowSettings::ShadowPlacement | shadowPlacement () const | 
| Returns the placement for the drop shadow.  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... | |
Container for settings relating to a text shadow.
Definition at line 36 of file qgstextshadowsettings.h.
Placement positions for text shadow.
| Enumerator | |
|---|---|
| ShadowLowest | Draw shadow below all text components. | 
| ShadowText | Draw shadow under text. | 
| ShadowBuffer | Draw shadow under buffer. | 
| ShadowShape | Draw shadow under background shape. | 
Definition at line 43 of file qgstextshadowsettings.h.
| QgsTextShadowSettings::QgsTextShadowSettings | ( | ) | 
Definition at line 25 of file qgstextshadowsettings.cpp.
| QgsTextShadowSettings::QgsTextShadowSettings | ( | const QgsTextShadowSettings & | other | ) | 
Copy constructor.
| other | source QgsTextShadowSettings | 
Definition at line 30 of file qgstextshadowsettings.cpp.
| QgsTextShadowSettings::~QgsTextShadowSettings | ( | ) | 
Definition at line 42 of file qgstextshadowsettings.cpp.
| QPainter::CompositionMode QgsTextShadowSettings::blendMode | ( | ) | const | 
Returns the blending mode used for drawing the drop shadow.
Definition at line 214 of file qgstextshadowsettings.cpp.
| bool QgsTextShadowSettings::blurAlphaOnly | ( | ) | const | 
Returns whether only the alpha channel for the shadow will be blurred.
Definition at line 174 of file qgstextshadowsettings.cpp.
| double QgsTextShadowSettings::blurRadius | ( | ) | const | 
Returns the blur radius for the shadow.
Radius units are retrieved via blurRadiusUnits().
Definition at line 144 of file qgstextshadowsettings.cpp.
| QgsMapUnitScale QgsTextShadowSettings::blurRadiusMapUnitScale | ( | ) | const | 
Returns the map unit scale object for the shadow blur radius.
This is only used if the blurRadiusUnit() is set to QgsUnitTypes::RenderMapUnit.
Definition at line 164 of file qgstextshadowsettings.cpp.
| Qgis::RenderUnit QgsTextShadowSettings::blurRadiusUnit | ( | ) | const | 
Returns the units used for the shadow's blur radius.
Definition at line 154 of file qgstextshadowsettings.cpp.
| QColor QgsTextShadowSettings::color | ( | ) | const | 
Returns the color of the drop shadow.
Definition at line 204 of file qgstextshadowsettings.cpp.
| bool QgsTextShadowSettings::enabled | ( | ) | const | 
Returns whether the shadow is enabled.
Definition at line 74 of file qgstextshadowsettings.cpp.
| int QgsTextShadowSettings::offsetAngle | ( | ) | const | 
Returns the angle for offsetting the position of the shadow from the text.
Definition at line 94 of file qgstextshadowsettings.cpp.
| double QgsTextShadowSettings::offsetDistance | ( | ) | const | 
Returns the distance for offsetting the position of the shadow from the text.
Offset units are retrieved via offsetUnit().
Definition at line 104 of file qgstextshadowsettings.cpp.
| bool QgsTextShadowSettings::offsetGlobal | ( | ) | const | 
Returns true if the global shadow offset will be used. 
Definition at line 134 of file qgstextshadowsettings.cpp.
| QgsMapUnitScale QgsTextShadowSettings::offsetMapUnitScale | ( | ) | const | 
Returns the map unit scale object for the shadow offset distance.
This is only used if the offsetUnit() is set to QgsUnitTypes::RenderMapUnit.
Definition at line 124 of file qgstextshadowsettings.cpp.
| Qgis::RenderUnit QgsTextShadowSettings::offsetUnit | ( | ) | const | 
Returns the units used for the shadow's offset.
Definition at line 114 of file qgstextshadowsettings.cpp.
| double QgsTextShadowSettings::opacity | ( | ) | const | 
Returns the shadow's opacity.
The opacity is a double value between 0 (fully transparent) and 1 (totally opaque).
Definition at line 184 of file qgstextshadowsettings.cpp.
| bool QgsTextShadowSettings::operator!= | ( | const QgsTextShadowSettings & | other | ) | const | 
Definition at line 69 of file qgstextshadowsettings.cpp.
| QgsTextShadowSettings & QgsTextShadowSettings::operator= | ( | const QgsTextShadowSettings & | other | ) | 
Definition at line 36 of file qgstextshadowsettings.cpp.
| bool QgsTextShadowSettings::operator== | ( | const QgsTextShadowSettings & | other | ) | const | 
Definition at line 47 of file qgstextshadowsettings.cpp.
| void QgsTextShadowSettings::readFromLayer | ( | QgsVectorLayer * | layer | ) | 
Reads settings from a layer's custom properties (for QGIS 2.x projects).
| layer | source vector layer | 
Definition at line 224 of file qgstextshadowsettings.cpp.
| void QgsTextShadowSettings::readXml | ( | const QDomElement & | elem | ) | 
Read settings from a DOM element.
Definition at line 290 of file qgstextshadowsettings.cpp.
| QSet< QString > QgsTextShadowSettings::referencedFields | ( | const QgsRenderContext & | context | ) | const | 
Returns all field names referenced by the configuration (e.g.
from data defined properties).
Definition at line 472 of file qgstextshadowsettings.cpp.
| int QgsTextShadowSettings::scale | ( | ) | const | 
Returns the scaling used for the drop shadow (in percentage of original size).
Definition at line 194 of file qgstextshadowsettings.cpp.
| void QgsTextShadowSettings::setBlendMode | ( | QPainter::CompositionMode | mode | ) | 
Sets the blending mode used for drawing the drop shadow.
| mode | blending mode | 
Definition at line 219 of file qgstextshadowsettings.cpp.
| void QgsTextShadowSettings::setBlurAlphaOnly | ( | bool | alphaOnly | ) | 
Sets whether only the alpha channel for the shadow should be blurred.
| alphaOnly | set to trueto blur only the alpha channel. Iffalse, all channels (including red, green and blue channel) will be blurred. | 
Definition at line 179 of file qgstextshadowsettings.cpp.
| void QgsTextShadowSettings::setBlurRadius | ( | double | blurRadius | ) | 
Sets the blur radius for the shadow.
Radius units are specified via setBlurRadiusUnits().
| blurRadius | blur radius | 
Definition at line 149 of file qgstextshadowsettings.cpp.
| void QgsTextShadowSettings::setBlurRadiusMapUnitScale | ( | const QgsMapUnitScale & | scale | ) | 
Sets the map unit scale object for the shadow blur radius.
This is only used if the blurRadiusUnit() is set to QgsUnitTypes::RenderMapUnit.
| scale | scale for shadow blur radius | 
Definition at line 169 of file qgstextshadowsettings.cpp.
| void QgsTextShadowSettings::setBlurRadiusUnit | ( | Qgis::RenderUnit | units | ) | 
Sets the units used for the shadow's blur radius.
| units | shadow blur radius units | 
Definition at line 159 of file qgstextshadowsettings.cpp.
| void QgsTextShadowSettings::setColor | ( | const QColor & | color | ) | 
Sets the color for the drop shadow.
| color | shadow color | 
Definition at line 209 of file qgstextshadowsettings.cpp.
| void QgsTextShadowSettings::setEnabled | ( | bool | enabled | ) | 
Sets whether the text shadow will be drawn.
| enabled | set to trueto draw shadow | 
Definition at line 79 of file qgstextshadowsettings.cpp.
| void QgsTextShadowSettings::setOffsetAngle | ( | int | angle | ) | 
Sets the angle for offsetting the position of the shadow from the text.
| angle | offset angle in degrees | 
Definition at line 99 of file qgstextshadowsettings.cpp.
| void QgsTextShadowSettings::setOffsetDistance | ( | double | distance | ) | 
Sets the distance for offsetting the position of the shadow from the text.
Offset units are specified via setOffsetUnit().
| distance | offset distance | 
Definition at line 109 of file qgstextshadowsettings.cpp.
| void QgsTextShadowSettings::setOffsetGlobal | ( | bool | global | ) | 
Sets whether the global shadow offset should be used.
| global | set to trueto use global shadow offset. | 
Definition at line 139 of file qgstextshadowsettings.cpp.
| void QgsTextShadowSettings::setOffsetMapUnitScale | ( | const QgsMapUnitScale & | scale | ) | 
Sets the map unit scale object for the shadow offset distance.
This is only used if the offsetUnit() is set to QgsUnitTypes::RenderMapUnit.
| scale | scale for shadow offset | 
Definition at line 129 of file qgstextshadowsettings.cpp.
| void QgsTextShadowSettings::setOffsetUnit | ( | Qgis::RenderUnit | units | ) | 
Sets the units used for the shadow's offset.
| units | shadow distance units | 
Definition at line 119 of file qgstextshadowsettings.cpp.
| void QgsTextShadowSettings::setOpacity | ( | double | opacity | ) | 
Sets the shadow's opacity.
| opacity | opacity as a double value between 0 (fully transparent) and 1 (totally opaque) | 
Definition at line 189 of file qgstextshadowsettings.cpp.
| void QgsTextShadowSettings::setScale | ( | int | scale | ) | 
Sets the scaling used for the drop shadow (in percentage of original size).
| scale | scale percent for drop shadow | 
Definition at line 199 of file qgstextshadowsettings.cpp.
| void QgsTextShadowSettings::setShadowPlacement | ( | QgsTextShadowSettings::ShadowPlacement | placement | ) | 
Sets the placement for the drop shadow.
The placement determines both the z-order stacking position for the shadow and the what shape (e.g., text, background shape) is used for casting the shadow.
| placement | shadow placement | 
Definition at line 89 of file qgstextshadowsettings.cpp.
| QgsTextShadowSettings::ShadowPlacement QgsTextShadowSettings::shadowPlacement | ( | ) | const | 
Returns the placement for the drop shadow.
The placement determines both the z-order stacking position for the shadow and the what shape (e.g., text, background shape) is used for casting the shadow.
Definition at line 84 of file qgstextshadowsettings.cpp.
| void QgsTextShadowSettings::updateDataDefinedProperties | ( | QgsRenderContext & | context, | 
| const QgsPropertyCollection & | properties | ||
| ) | 
Updates the format by evaluating current values of data defined properties.
Definition at line 379 of file qgstextshadowsettings.cpp.
| QDomElement QgsTextShadowSettings::writeXml | ( | QDomDocument & | doc | ) | const | 
Write settings into a DOM element.
Definition at line 358 of file qgstextshadowsettings.cpp.