QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
qgstextbuffersettings.h
Go to the documentation of this file.
1/***************************************************************************
2 qgstextbuffersettings.h
3 -----------------
4 begin : May 2020
5 copyright : (C) Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7
8 ***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16
17#ifndef QGSTEXTBUFFERSETTINGS_H
18#define QGSTEXTBUFFERSETTINGS_H
19
20#include "qgis.h"
21#include "qgis_core.h"
22#include "qgis_sip.h"
23#include "qgsmapunitscale.h"
24
25#include <QDomElement>
26#include <QPainter>
27#include <QSharedData>
28
30class QgsTextBufferSettingsPrivate;
31class QgsVectorLayer;
32class QgsPaintEffect;
34
41class CORE_EXPORT QgsTextBufferSettings
42{
43 public:
44
46
49
52
54
55 bool operator==( const QgsTextBufferSettings &other ) const;
56 bool operator!=( const QgsTextBufferSettings &other ) const;
57
62 bool enabled() const;
63
69 void setEnabled( bool enabled );
70
76 double size() const;
77
84 void setSize( double size );
85
92
99 void setSizeUnit( Qgis::RenderUnit unit );
100
108
116 void setSizeMapUnitScale( const QgsMapUnitScale &scale );
117
122 QColor color() const;
123
129 void setColor( const QColor &color );
130
137 bool fillBufferInterior() const;
138
145 void setFillBufferInterior( bool fill );
146
152 double opacity() const;
153
160 void setOpacity( double opacity );
161
166 Qt::PenJoinStyle joinStyle() const;
167
173 void setJoinStyle( Qt::PenJoinStyle style );
174
179 QPainter::CompositionMode blendMode() const;
180
186 void setBlendMode( QPainter::CompositionMode mode );
187
192 void readFromLayer( QgsVectorLayer *layer );
193
198 void readXml( const QDomElement &elem );
199
204 QDomElement writeXml( QDomDocument &doc ) const;
205
211 const QgsPaintEffect *paintEffect() const;
212
219
224 void updateDataDefinedProperties( QgsRenderContext &context, const QgsPropertyCollection &properties );
225
230 QSet<QString> referencedFields( const QgsRenderContext &context ) const;
231
232 private:
233
234 QSharedDataPointer<QgsTextBufferSettingsPrivate> d;
235
236};
237
238#endif // QGSTEXTBUFFERSETTINGS_H
RenderUnit
Rendering size units.
Definition qgis.h:5183
Struct for storing maximum and minimum scales for measurements in map units.
Base class for visual effects which can be applied to QPicture drawings.
A grouped map of multiple QgsProperty objects, each referenced by an integer key value.
A container for the context for various read/write operations on objects.
Contains information about the context of a rendering operation.
QgsTextBufferSettings & operator=(const QgsTextBufferSettings &other)
void setFillBufferInterior(bool fill)
Sets whether the interior of the buffer will be filled in.
void setBlendMode(QPainter::CompositionMode mode)
Sets the blending mode used for drawing the buffer.
Qgis::RenderUnit sizeUnit() const
Returns the units for the buffer size.
void readFromLayer(QgsVectorLayer *layer)
Reads settings from a layer's custom properties (for QGIS 2.x projects).
QSet< QString > referencedFields(const QgsRenderContext &context) const
Returns all field names referenced by the configuration (e.g.
Qt::PenJoinStyle joinStyle() const
Returns the buffer join style.
double size() const
Returns the size of the buffer.
void setColor(const QColor &color)
Sets the color for the buffer.
void setSizeMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale object for the buffer size.
void setOpacity(double opacity)
Sets the buffer opacity.
QgsMapUnitScale sizeMapUnitScale() const
Returns the map unit scale object for the buffer size.
bool enabled() const
Returns whether the buffer is enabled.
double opacity() const
Returns the buffer opacity.
void setSizeUnit(Qgis::RenderUnit unit)
Sets the units used for the buffer size.
QDomElement writeXml(QDomDocument &doc) const
Write settings into a DOM element.
bool fillBufferInterior() const
Returns whether the interior of the buffer will be filled in.
void setEnabled(bool enabled)
Sets whether the text buffer will be drawn.
void setPaintEffect(QgsPaintEffect *effect)
Sets the current paint effect for the buffer.
const QgsPaintEffect * paintEffect() const
Returns the current paint effect for the buffer.
QColor color() const
Returns the color of the buffer.
QPainter::CompositionMode blendMode() const
Returns the blending mode used for drawing the buffer.
void updateDataDefinedProperties(QgsRenderContext &context, const QgsPropertyCollection &properties)
Updates the format by evaluating current values of data defined properties.
void setJoinStyle(Qt::PenJoinStyle style)
Sets the join style used for drawing the buffer.
void setSize(double size)
Sets the size of the buffer.
void readXml(const QDomElement &elem)
Read settings from a DOM element.
Represents a vector layer which manages a vector based dataset.
#define SIP_SKIP
Definition qgis_sip.h:134
#define SIP_TRANSFER
Definition qgis_sip.h:36
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)