QGIS API Documentation
3.2.0-Bonn (bc43194)
|
Container for settings relating to a text buffer. More...
#include <qgstextrenderer.h>
Public Member Functions | |
QgsTextBufferSettings () | |
QgsTextBufferSettings (const QgsTextBufferSettings &other) | |
Copy constructor. More... | |
~QgsTextBufferSettings () | |
QPainter::CompositionMode | blendMode () const |
Returns the blending mode used for drawing the buffer. More... | |
QColor | color () const |
Returns the color of the buffer. More... | |
bool | enabled () const |
Returns whether the buffer is enabled. More... | |
bool | fillBufferInterior () const |
Returns whether the interior of the buffer will be filled in. More... | |
Qt::PenJoinStyle | joinStyle () const |
Returns the buffer join style. More... | |
double | opacity () const |
Returns the buffer opacity. More... | |
QgsTextBufferSettings & | operator= (const QgsTextBufferSettings &other) |
Copy constructor. More... | |
QgsPaintEffect * | paintEffect () const |
Returns the current paint effect for the buffer. More... | |
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... | |
void | setBlendMode (QPainter::CompositionMode mode) |
Sets the blending mode used for drawing the buffer. More... | |
void | setColor (const QColor &color) |
Sets the color for the buffer. More... | |
void | setEnabled (bool enabled) |
Sets whether the text buffer will be drawn. More... | |
void | setFillBufferInterior (bool fill) |
Sets whether the interior of the buffer will be filled in. More... | |
void | setJoinStyle (Qt::PenJoinStyle style) |
Sets the join style used for drawing the buffer. More... | |
void | setOpacity (double opacity) |
Sets the buffer opacity. More... | |
void | setPaintEffect (QgsPaintEffect *effect) |
Sets the current paint effect for the buffer. 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 (QgsUnitTypes::RenderUnit unit) |
Sets the units used for the buffer size. 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... | |
QgsUnitTypes::RenderUnit | sizeUnit () const |
Returns the units for the buffer size. More... | |
QDomElement | writeXml (QDomDocument &doc) const |
Write settings into a DOM element. More... | |
Container for settings relating to a text buffer.
Definition at line 46 of file qgstextrenderer.h.
QgsTextBufferSettings::QgsTextBufferSettings | ( | ) |
Definition at line 66 of file qgstextrenderer.cpp.
QgsTextBufferSettings::QgsTextBufferSettings | ( | const QgsTextBufferSettings & | other | ) |
Copy constructor.
other | source settings |
Definition at line 71 of file qgstextrenderer.cpp.
QgsTextBufferSettings::~QgsTextBufferSettings | ( | ) |
Definition at line 82 of file qgstextrenderer.cpp.
QPainter::CompositionMode QgsTextBufferSettings::blendMode | ( | ) | const |
Returns the blending mode used for drawing the buffer.
Definition at line 167 of file qgstextrenderer.cpp.
QColor QgsTextBufferSettings::color | ( | ) | const |
Returns the color of the buffer.
Definition at line 127 of file qgstextrenderer.cpp.
bool QgsTextBufferSettings::enabled | ( | ) | const |
Returns whether the buffer is enabled.
Definition at line 87 of file qgstextrenderer.cpp.
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.
Definition at line 137 of file qgstextrenderer.cpp.
Qt::PenJoinStyle QgsTextBufferSettings::joinStyle | ( | ) | const |
Returns the buffer join style.
Definition at line 157 of file qgstextrenderer.cpp.
double QgsTextBufferSettings::opacity | ( | ) | const |
Returns the buffer opacity.
The opacity is a double value between 0 (fully transparent) and 1 (totally opaque).
Definition at line 147 of file qgstextrenderer.cpp.
QgsTextBufferSettings & QgsTextBufferSettings::operator= | ( | const QgsTextBufferSettings & | other | ) |
Copy constructor.
other | source QgsTextBufferSettings |
Definition at line 76 of file qgstextrenderer.cpp.
QgsPaintEffect * QgsTextBufferSettings::paintEffect | ( | ) | const |
Returns the current paint effect for the buffer.
Definition at line 177 of file qgstextrenderer.cpp.
void QgsTextBufferSettings::readFromLayer | ( | QgsVectorLayer * | layer | ) |
Reads settings from a layer's custom properties (for QGIS 2.x projects).
layer | source vector layer |
Definition at line 188 of file qgstextrenderer.cpp.
void QgsTextBufferSettings::readXml | ( | const QDomElement & | elem | ) |
Read settings from a DOM element.
Definition at line 259 of file qgstextrenderer.cpp.
void QgsTextBufferSettings::setBlendMode | ( | QPainter::CompositionMode | mode | ) |
Sets the blending mode used for drawing the buffer.
mode | blending mode |
Definition at line 172 of file qgstextrenderer.cpp.
void QgsTextBufferSettings::setColor | ( | const QColor & | color | ) |
Sets the color for the buffer.
color | buffer color |
Definition at line 132 of file qgstextrenderer.cpp.
void QgsTextBufferSettings::setEnabled | ( | bool | enabled | ) |
Sets whether the text buffer will be drawn.
enabled | set to true to draw buffer |
Definition at line 92 of file qgstextrenderer.cpp.
void QgsTextBufferSettings::setFillBufferInterior | ( | bool | fill | ) |
Sets whether the interior of the buffer will be filled in.
fill | set 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. |
Definition at line 142 of file qgstextrenderer.cpp.
void QgsTextBufferSettings::setJoinStyle | ( | Qt::PenJoinStyle | style | ) |
Sets the join style used for drawing the buffer.
style | join style |
Definition at line 162 of file qgstextrenderer.cpp.
void QgsTextBufferSettings::setOpacity | ( | double | opacity | ) |
Sets the buffer opacity.
opacity | opacity as a double value between 0 (fully transparent) and 1 (totally opaque) |
Definition at line 152 of file qgstextrenderer.cpp.
void QgsTextBufferSettings::setPaintEffect | ( | QgsPaintEffect * | effect | ) |
Sets the current paint effect for the buffer.
effect | paint effect. Ownership is transferred to the buffer settings. |
Definition at line 182 of file qgstextrenderer.cpp.
void QgsTextBufferSettings::setSize | ( | double | size | ) |
Sets the size of the buffer.
The size units are specified using setSizeUnit().
size | buffer size |
Definition at line 102 of file qgstextrenderer.cpp.
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.
scale | scale for buffer size |
Definition at line 122 of file qgstextrenderer.cpp.
void QgsTextBufferSettings::setSizeUnit | ( | QgsUnitTypes::RenderUnit | unit | ) |
Sets the units used for the buffer size.
unit | size unit |
Definition at line 112 of file qgstextrenderer.cpp.
double QgsTextBufferSettings::size | ( | ) | const |
Returns the size of the buffer.
Definition at line 97 of file qgstextrenderer.cpp.
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.
Definition at line 117 of file qgstextrenderer.cpp.
QgsUnitTypes::RenderUnit QgsTextBufferSettings::sizeUnit | ( | ) | const |
Returns the units for the buffer size.
Definition at line 107 of file qgstextrenderer.cpp.
QDomElement QgsTextBufferSettings::writeXml | ( | QDomDocument & | doc | ) | const |
Write settings into a DOM element.
Definition at line 326 of file qgstextrenderer.cpp.