QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
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:
45
48
51
53
54 bool operator==( const QgsTextBufferSettings &other ) const;
55 bool operator!=( const QgsTextBufferSettings &other ) const;
56
61 bool enabled() const;
62
68 void setEnabled( bool enabled );
69
75 double size() const;
76
83 void setSize( double size );
84
91
98 void setSizeUnit( Qgis::RenderUnit unit );
99
107
115 void setSizeMapUnitScale( const QgsMapUnitScale &scale );
116
121 QColor color() const;
122
128 void setColor( const QColor &color );
129
136 bool fillBufferInterior() const;
137
144 void setFillBufferInterior( bool fill );
145
151 double opacity() const;
152
159 void setOpacity( double opacity );
160
165 Qt::PenJoinStyle joinStyle() const;
166
172 void setJoinStyle( Qt::PenJoinStyle style );
173
178 QPainter::CompositionMode blendMode() const;
179
185 void setBlendMode( QPainter::CompositionMode mode );
186
191 void readFromLayer( QgsVectorLayer *layer );
192
197 void readXml( const QDomElement &elem );
198
203 QDomElement writeXml( QDomDocument &doc ) const;
204
210 const QgsPaintEffect *paintEffect() const;
211
218
223 void updateDataDefinedProperties( QgsRenderContext &context, const QgsPropertyCollection &properties );
224
229 QSet<QString> referencedFields( const QgsRenderContext &context ) const;
230
231 private:
232 QSharedDataPointer<QgsTextBufferSettingsPrivate> d;
233};
234
235#endif // QGSTEXTBUFFERSETTINGS_H
RenderUnit
Rendering size units.
Definition qgis.h:5340
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:133
#define SIP_TRANSFER
Definition qgis_sip.h:35
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)