QGIS API Documentation 3.99.0-Master (26c88405ac0)
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.h"
20#include "qgis_core.h"
21#include "qgis_sip.h"
22#include "qgsmapunitscale.h"
23
24#include <QDomElement>
25#include <QPainter>
26#include <QPointF>
27#include <QSharedDataPointer>
28#include <QSizeF>
29#include <QString>
30
31class QgsMarkerSymbol;
32class QgsFillSymbol;
33class QgsPaintEffect;
34class QgsVectorLayer;
37class QgsTextBackgroundSettingsPrivate;
38
46{
47 public:
48
61
71
81
83
86
89
91
92 bool operator==( const QgsTextBackgroundSettings &other ) const;
93 bool operator!=( const QgsTextBackgroundSettings &other ) const;
94
99 bool enabled() const;
100
106 void setEnabled( bool enabled );
107
112 ShapeType type() const;
113
119 void setType( ShapeType type );
120
125 QString svgFile() const;
126
133 void setSvgFile( const QString &file );
134
142 QgsMarkerSymbol *markerSymbol() const;
143
151 void setMarkerSymbol( QgsMarkerSymbol *symbol SIP_TRANSFER );
152
162 QgsFillSymbol *fillSymbol() const;
163
173 void setFillSymbol( QgsFillSymbol *symbol SIP_TRANSFER );
174
181 SizeType sizeType() const;
182
190 void setSizeType( SizeType type );
191
200 QSizeF size() const;
201
211 void setSize( QSizeF size );
212
220 Qgis::RenderUnit sizeUnit() const;
221
230 void setSizeUnit( Qgis::RenderUnit unit );
231
238 QgsMapUnitScale sizeMapUnitScale() const;
239
247 void setSizeMapUnitScale( const QgsMapUnitScale &scale );
248
254 RotationType rotationType() const;
255
262 void setRotationType( RotationType type );
263
269 double rotation() const;
270
276 void setRotation( double rotation );
277
284 QPointF offset() const;
285
293 void setOffset( QPointF offset );
294
300 Qgis::RenderUnit offsetUnit() const;
301
308 void setOffsetUnit( Qgis::RenderUnit units );
309
316 QgsMapUnitScale offsetMapUnitScale() const;
317
325 void setOffsetMapUnitScale( const QgsMapUnitScale &scale );
326
333 QSizeF radii() const;
334
343 void setRadii( QSizeF radii );
344
350 Qgis::RenderUnit radiiUnit() const;
351
358 void setRadiiUnit( Qgis::RenderUnit units );
359
366 QgsMapUnitScale radiiMapUnitScale() const;
367
375 void setRadiiMapUnitScale( const QgsMapUnitScale &scale );
376
382 double opacity() const;
383
390 void setOpacity( double opacity );
391
396 QPainter::CompositionMode blendMode() const;
397
403 void setBlendMode( QPainter::CompositionMode mode );
404
412 QColor fillColor() const;
413
422 void setFillColor( const QColor &color );
423
431 QColor strokeColor() const;
432
439 void setStrokeColor( const QColor &color );
440
447 double strokeWidth() const;
448
457 void setStrokeWidth( double width );
458
464 Qgis::RenderUnit strokeWidthUnit() const;
465
474 void setStrokeWidthUnit( Qgis::RenderUnit units );
475
482 QgsMapUnitScale strokeWidthMapUnitScale() const;
483
493 void setStrokeWidthMapUnitScale( const QgsMapUnitScale &scale );
494
499 Qt::PenJoinStyle joinStyle() const;
500
508 void setJoinStyle( Qt::PenJoinStyle style );
509
515 const QgsPaintEffect *paintEffect() const;
516
522 void setPaintEffect( QgsPaintEffect *effect SIP_TRANSFER );
523
528 void readFromLayer( QgsVectorLayer *layer );
529
534 void readXml( const QDomElement &elem, const QgsReadWriteContext &context );
535
540 QDomElement writeXml( QDomDocument &doc, const QgsReadWriteContext &context ) const;
541
549 void updateDataDefinedProperties( QgsRenderContext &context, const QgsPropertyCollection &properties );
550
555 void upgradeDataDefinedProperties( QgsPropertyCollection &properties ) SIP_SKIP;
556
561 QSet<QString> referencedFields( const QgsRenderContext &context ) const;
562
563 private:
564
565 QSharedDataPointer<QgsTextBackgroundSettingsPrivate> d;
566
567};
568
569#endif // QGSTEXTBACKGROUNDSETTINGS_H
RenderUnit
Rendering size units.
Definition qgis.h:5183
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 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.
Container for settings relating to a text background object.
SizeType
Methods for determining the background shape size.
@ SizePercent
Shape size is determined by percent of text size.
@ SizeBuffer
Shape size is determined by adding a buffer margin around text.
@ ShapeSquare
Square - buffered sizes only.
RotationType
Methods for determining the rotation of the background shape.
@ RotationOffset
Shape rotation is offset from text rotation.
@ RotationSync
Shape rotation is synced with text rotation.
@ RotationFixed
Shape rotation is a fixed angle.
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)