QGIS API Documentation 3.38.0-Grenoble (exported)
Loading...
Searching...
No Matches
qgstextbackgroundsettings.h
Go to the documentation of this file.
1/***************************************************************************
2 qgstextbackgroundsettings.h
3 -----------------
4 begin : May 2020
5 copyright : (C) Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSTEXTBACKGROUNDSETTINGS_H
17#define QGSTEXTBACKGROUNDSETTINGS_H
18
19#include "qgis_sip.h"
20#include "qgis_core.h"
21#include "qgis.h"
22#include "qgsmapunitscale.h"
23
24#include <QString>
25#include <QPointF>
26#include <QSizeF>
27#include <QPainter>
28#include <QDomElement>
29#include <QSharedDataPointer>
30
31class QgsMarkerSymbol;
32class QgsFillSymbol;
33class QgsPaintEffect;
34class QgsVectorLayer;
37class QgsTextBackgroundSettingsPrivate;
38
46{
47 public:
48
61
66 {
67 SizeBuffer = 0,
69 SizePercent
70 };
71
76 {
77 RotationSync = 0,
79 RotationFixed
80 };
81
83
89
91
93
94 bool operator==( const QgsTextBackgroundSettings &other ) const;
95 bool operator!=( const QgsTextBackgroundSettings &other ) const;
96
101 bool enabled() const;
102
108 void setEnabled( bool enabled );
109
114 ShapeType type() const;
115
121 void setType( ShapeType type );
122
127 QString svgFile() const;
128
135 void setSvgFile( const QString &file );
136
144 QgsMarkerSymbol *markerSymbol() const;
145
153 void setMarkerSymbol( QgsMarkerSymbol *symbol SIP_TRANSFER );
154
164 QgsFillSymbol *fillSymbol() const;
165
175 void setFillSymbol( QgsFillSymbol *symbol SIP_TRANSFER );
176
183 SizeType sizeType() const;
184
192 void setSizeType( SizeType type );
193
202 QSizeF size() const;
203
213 void setSize( QSizeF size );
214
222 Qgis::RenderUnit sizeUnit() const;
223
232 void setSizeUnit( Qgis::RenderUnit unit );
233
240 QgsMapUnitScale sizeMapUnitScale() const;
241
249 void setSizeMapUnitScale( const QgsMapUnitScale &scale );
250
256 RotationType rotationType() const;
257
264 void setRotationType( RotationType type );
265
271 double rotation() const;
272
278 void setRotation( double rotation );
279
286 QPointF offset() const;
287
295 void setOffset( QPointF offset );
296
302 Qgis::RenderUnit offsetUnit() const;
303
310 void setOffsetUnit( Qgis::RenderUnit units );
311
318 QgsMapUnitScale offsetMapUnitScale() const;
319
327 void setOffsetMapUnitScale( const QgsMapUnitScale &scale );
328
335 QSizeF radii() const;
336
345 void setRadii( QSizeF radii );
346
352 Qgis::RenderUnit radiiUnit() const;
353
360 void setRadiiUnit( Qgis::RenderUnit units );
361
368 QgsMapUnitScale radiiMapUnitScale() const;
369
377 void setRadiiMapUnitScale( const QgsMapUnitScale &scale );
378
384 double opacity() const;
385
392 void setOpacity( double opacity );
393
398 QPainter::CompositionMode blendMode() const;
399
405 void setBlendMode( QPainter::CompositionMode mode );
406
414 QColor fillColor() const;
415
424 void setFillColor( const QColor &color );
425
433 QColor strokeColor() const;
434
441 void setStrokeColor( const QColor &color );
442
449 double strokeWidth() const;
450
459 void setStrokeWidth( double width );
460
466 Qgis::RenderUnit strokeWidthUnit() const;
467
476 void setStrokeWidthUnit( Qgis::RenderUnit units );
477
484 QgsMapUnitScale strokeWidthMapUnitScale() const;
485
495 void setStrokeWidthMapUnitScale( const QgsMapUnitScale &scale );
496
501 Qt::PenJoinStyle joinStyle() const;
502
510 void setJoinStyle( Qt::PenJoinStyle style );
511
517 const QgsPaintEffect *paintEffect() const;
518
524 void setPaintEffect( QgsPaintEffect *effect SIP_TRANSFER );
525
530 void readFromLayer( QgsVectorLayer *layer );
531
536 void readXml( const QDomElement &elem, const QgsReadWriteContext &context );
537
542 QDomElement writeXml( QDomDocument &doc, const QgsReadWriteContext &context ) const;
543
551 void updateDataDefinedProperties( QgsRenderContext &context, const QgsPropertyCollection &properties );
552
557 void upgradeDataDefinedProperties( QgsPropertyCollection &properties ) SIP_SKIP;
558
563 QSet<QString> referencedFields( const QgsRenderContext &context ) const;
564
565 private:
566
567 QSharedDataPointer<QgsTextBackgroundSettingsPrivate> d;
568
569};
570
571#endif // QGSTEXTBACKGROUNDSETTINGS_H
RenderUnit
Rendering size units.
Definition qgis.h:4489
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
Struct for storing maximum and minimum scales for measurements in map units.
A marker symbol type, for rendering Point and MultiPoint geometries.
Base class for visual effects which can be applied to QPicture drawings.
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
The class is used as a container of context for various read/write operations on other objects.
Contains information about the context of a rendering operation.
Container for settings relating to a text background object.
SizeType
Methods for determining the background shape size.
@ ShapeSquare
Square - buffered sizes only.
RotationType
Methods for determining the rotation of the background shape.
@ RotationOffset
Shape rotation is offset from text rotation.
Represents a vector layer which manages a vector based data sets.
#define SIP_SKIP
Definition qgis_sip.h:126
#define SIP_TRANSFER
Definition qgis_sip.h:36
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)