QGIS API Documentation 4.1.0-Master (60fea48833c)
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:
60
70
80
82
85
88
90
91 bool operator==( const QgsTextBackgroundSettings &other ) const;
92 bool operator!=( const QgsTextBackgroundSettings &other ) const;
93
98 bool enabled() const;
99
105 void setEnabled( bool enabled );
106
111 ShapeType type() const;
112
118 void setType( ShapeType type );
119
124 QString svgFile() const;
125
132 void setSvgFile( const QString &file );
133
141 QgsMarkerSymbol *markerSymbol() const;
142
150 void setMarkerSymbol( QgsMarkerSymbol *symbol SIP_TRANSFER );
151
161 QgsFillSymbol *fillSymbol() const;
162
172 void setFillSymbol( QgsFillSymbol *symbol SIP_TRANSFER );
173
180 SizeType sizeType() const;
181
189 void setSizeType( SizeType type );
190
199 QSizeF size() const;
200
210 void setSize( QSizeF size );
211
219 Qgis::RenderUnit sizeUnit() const;
220
229 void setSizeUnit( Qgis::RenderUnit unit );
230
237 QgsMapUnitScale sizeMapUnitScale() const;
238
246 void setSizeMapUnitScale( const QgsMapUnitScale &scale );
247
253 RotationType rotationType() const;
254
261 void setRotationType( RotationType type );
262
268 double rotation() const;
269
275 void setRotation( double rotation );
276
283 QPointF offset() const;
284
292 void setOffset( QPointF offset );
293
299 Qgis::RenderUnit offsetUnit() const;
300
307 void setOffsetUnit( Qgis::RenderUnit units );
308
315 QgsMapUnitScale offsetMapUnitScale() const;
316
324 void setOffsetMapUnitScale( const QgsMapUnitScale &scale );
325
332 QSizeF radii() const;
333
342 void setRadii( QSizeF radii );
343
349 Qgis::RenderUnit radiiUnit() const;
350
357 void setRadiiUnit( Qgis::RenderUnit units );
358
365 QgsMapUnitScale radiiMapUnitScale() const;
366
374 void setRadiiMapUnitScale( const QgsMapUnitScale &scale );
375
381 double opacity() const;
382
389 void setOpacity( double opacity );
390
395 QPainter::CompositionMode blendMode() const;
396
402 void setBlendMode( QPainter::CompositionMode mode );
403
411 QColor fillColor() const;
412
421 void setFillColor( const QColor &color );
422
430 QColor strokeColor() const;
431
438 void setStrokeColor( const QColor &color );
439
446 double strokeWidth() const;
447
456 void setStrokeWidth( double width );
457
463 Qgis::RenderUnit strokeWidthUnit() const;
464
473 void setStrokeWidthUnit( Qgis::RenderUnit units );
474
481 QgsMapUnitScale strokeWidthMapUnitScale() const;
482
492 void setStrokeWidthMapUnitScale( const QgsMapUnitScale &scale );
493
498 Qt::PenJoinStyle joinStyle() const;
499
507 void setJoinStyle( Qt::PenJoinStyle style );
508
514 const QgsPaintEffect *paintEffect() const;
515
521 void setPaintEffect( QgsPaintEffect *effect SIP_TRANSFER );
522
527 void readFromLayer( QgsVectorLayer *layer );
528
533 void readXml( const QDomElement &elem, const QgsReadWriteContext &context );
534
539 QDomElement writeXml( QDomDocument &doc, const QgsReadWriteContext &context ) const;
540
548 void updateDataDefinedProperties( QgsRenderContext &context, const QgsPropertyCollection &properties );
549
554 void upgradeDataDefinedProperties( QgsPropertyCollection &properties ) SIP_SKIP;
555
560 QSet<QString> referencedFields( const QgsRenderContext &context ) const;
561
562 private:
563 QSharedDataPointer<QgsTextBackgroundSettingsPrivate> d;
564};
565
566#endif // QGSTEXTBACKGROUNDSETTINGS_H
RenderUnit
Rendering size units.
Definition qgis.h:5340
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: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)