QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
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
85
87
89
90 bool operator==( const QgsTextBackgroundSettings &other ) const;
91 bool operator!=( const QgsTextBackgroundSettings &other ) const;
92
97 bool enabled() const;
98
104 void setEnabled( bool enabled );
105
110 ShapeType type() const;
111
117 void setType( ShapeType type );
118
123 QString svgFile() const;
124
131 void setSvgFile( const QString &file );
132
140 QgsMarkerSymbol *markerSymbol() const;
141
149 void setMarkerSymbol( QgsMarkerSymbol *symbol SIP_TRANSFER );
150
160 QgsFillSymbol *fillSymbol() const;
161
171 void setFillSymbol( QgsFillSymbol *symbol SIP_TRANSFER );
172
179 SizeType sizeType() const;
180
188 void setSizeType( SizeType type );
189
198 QSizeF size() const;
199
209 void setSize( QSizeF size );
210
218 Qgis::RenderUnit sizeUnit() const;
219
228 void setSizeUnit( Qgis::RenderUnit unit );
229
236 QgsMapUnitScale sizeMapUnitScale() const;
237
245 void setSizeMapUnitScale( const QgsMapUnitScale &scale );
246
252 RotationType rotationType() const;
253
260 void setRotationType( RotationType type );
261
267 double rotation() const;
268
274 void setRotation( double rotation );
275
282 QPointF offset() const;
283
291 void setOffset( QPointF offset );
292
298 Qgis::RenderUnit offsetUnit() const;
299
306 void setOffsetUnit( Qgis::RenderUnit units );
307
314 QgsMapUnitScale offsetMapUnitScale() const;
315
323 void setOffsetMapUnitScale( const QgsMapUnitScale &scale );
324
331 QSizeF radii() const;
332
341 void setRadii( QSizeF radii );
342
348 Qgis::RenderUnit radiiUnit() const;
349
356 void setRadiiUnit( Qgis::RenderUnit units );
357
364 QgsMapUnitScale radiiMapUnitScale() const;
365
373 void setRadiiMapUnitScale( const QgsMapUnitScale &scale );
374
380 double opacity() const;
381
388 void setOpacity( double opacity );
389
394 QPainter::CompositionMode blendMode() const;
395
401 void setBlendMode( QPainter::CompositionMode mode );
402
410 QColor fillColor() const;
411
420 void setFillColor( const QColor &color );
421
429 QColor strokeColor() const;
430
437 void setStrokeColor( const QColor &color );
438
445 double strokeWidth() const;
446
455 void setStrokeWidth( double width );
456
462 Qgis::RenderUnit strokeWidthUnit() const;
463
472 void setStrokeWidthUnit( Qgis::RenderUnit units );
473
480 QgsMapUnitScale strokeWidthMapUnitScale() const;
481
491 void setStrokeWidthMapUnitScale( const QgsMapUnitScale &scale );
492
497 Qt::PenJoinStyle joinStyle() const;
498
506 void setJoinStyle( Qt::PenJoinStyle style );
507
513 const QgsPaintEffect *paintEffect() const;
514
520 void setPaintEffect( QgsPaintEffect *effect SIP_TRANSFER );
521
526 void readFromLayer( QgsVectorLayer *layer );
527
532 void readXml( const QDomElement &elem, const QgsReadWriteContext &context );
533
538 QDomElement writeXml( QDomDocument &doc, const QgsReadWriteContext &context ) const;
539
547 void updateDataDefinedProperties( QgsRenderContext &context, const QgsPropertyCollection &properties );
548
553 void upgradeDataDefinedProperties( QgsPropertyCollection &properties ) SIP_SKIP;
554
559 QSet<QString> referencedFields( const QgsRenderContext &context ) const;
560
561 private:
562
563 QSharedDataPointer<QgsTextBackgroundSettingsPrivate> d;
564
565};
566
567#endif // QGSTEXTBACKGROUNDSETTINGS_H
RenderUnit
Rendering size units.
Definition qgis.h:4839
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)