QGIS API Documentation 3.99.0-Master (d270888f95f)
Loading...
Searching...
No Matches
qgscreateannotationitemmaptool_impl.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgscreateannotationitemmaptool_impl.cpp
3 ------------------------
4 Date : September 2021
5 Copyright : (C) 2021 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
17
19#include "qgsannotationlayer.h"
27#include "qgsapplication.h"
28#include "qgscurvepolygon.h"
29#include "qgsfillsymbol.h"
30#include "qgsimagecache.h"
31#include "qgslinesymbol.h"
32#include "qgsmapcanvas.h"
33#include "qgsmapmouseevent.h"
34#include "qgsmarkersymbol.h"
36#include "qgsrubberband.h"
38#include "qgsstyle.h"
39#include "qgssvgcache.h"
40
41#include <QFileDialog>
42#include <QImageReader>
43#include <QString>
44
45#include "moc_qgscreateannotationitemmaptool_impl.cpp"
46
47using namespace Qt::StringLiterals;
48
50
51//
52// QgsMapToolCaptureAnnotationItem
53//
54
56 : QgsMapToolCapture( canvas, cadDockWidget, mode )
57{
58 mToolName = tr( "Annotation tool" );
59}
60
62{
63 return mHandler;
64}
65
67{
68 return this;
69}
70
72{
73 return mHandler->targetLayer();
74}
75
76
78{
79 // no geometry validation!
80 return SupportsCurves;
81}
82
84{
85 switch ( technique )
86 {
92 return true;
93 }
95}
96
97
98//
99// QgsCreatePointTextItemMapTool
100//
101
103 : QgsMapToolAdvancedDigitizing( canvas, cadDockWidget )
104 , mHandler( new QgsCreateAnnotationItemMapToolHandler( canvas, cadDockWidget ) )
105{
106 setUseSnappingIndicator( true );
107}
108
110
112{
113 if ( event->button() != Qt::LeftButton )
114 return;
115
116 const QgsPointXY layerPoint = toLayerCoordinates( mHandler->targetLayer(), event->mapPoint() );
117
118 auto createdItem = std::make_unique<QgsAnnotationPointTextItem>( tr( "Text" ), layerPoint );
119 createdItem->setAlignment( Qt::AlignLeft );
121 // default to HTML formatting
122 format.setAllowHtmlFormatting( true );
123 createdItem->setFormat( format );
124 // newly created point text items default to using symbology reference scale at the current map scale
125 createdItem->setUseSymbologyReferenceScale( true );
126 createdItem->setSymbologyReferenceScale( canvas()->scale() );
127 mHandler->pushCreatedItem( createdItem.release() );
128}
129
131{
132 return mHandler;
133}
134
136{
137 return this;
138}
139
140
141//
142// QgsCreateMarkerMapTool
143//
144
146 : QgsMapToolCaptureAnnotationItem( canvas, cadDockWidget, CapturePoint )
147{
148 mHandler = new QgsCreateAnnotationItemMapToolHandler( canvas, cadDockWidget, this );
149}
150
152{
153 if ( event->button() != Qt::LeftButton )
154 return;
155
156 const QgsPointXY layerPoint = toLayerCoordinates( mHandler->targetLayer(), event->mapPoint() );
157 auto createdItem = std::make_unique<QgsAnnotationMarkerItem>( QgsPoint( layerPoint ) );
158
159 std::unique_ptr<QgsMarkerSymbol> markerSymbol = QgsApplication::recentStyleHandler()->recentSymbol<QgsMarkerSymbol>( u"marker_annotation_item"_s );
160 if ( !markerSymbol )
161 markerSymbol.reset( qgis::down_cast<QgsMarkerSymbol *>( QgsSymbol::defaultSymbol( Qgis::GeometryType::Point ) ) );
162 createdItem->setSymbol( markerSymbol.release() );
163
164 // set reference scale to match canvas scale, but don't enable it by default for marker items
165 createdItem->setSymbologyReferenceScale( canvas()->scale() );
166
167 mHandler->pushCreatedItem( createdItem.release() );
168
170
172}
173
174//
175// QgsCreateLineMapTool
176//
177
179 : QgsMapToolCaptureAnnotationItem( canvas, cadDockWidget, CaptureLine )
180{
181 mHandler = new QgsCreateAnnotationItemMapToolHandler( canvas, cadDockWidget, this );
182}
183
184void QgsCreateLineItemMapTool::lineCaptured( const QgsCurve *line )
185{
186 if ( line->isEmpty() )
187 return;
188
189 // do it!
190 std::unique_ptr<QgsAbstractGeometry> geometry( line->simplifiedTypeRef()->clone() );
191 if ( qgsgeometry_cast<QgsCurve *>( geometry.get() ) )
192 {
193 auto createdItem = std::make_unique<QgsAnnotationLineItem>( qgis::down_cast<QgsCurve *>( geometry.release() ) );
194
195 std::unique_ptr<QgsLineSymbol> lineSymbol = QgsApplication::recentStyleHandler()->recentSymbol<QgsLineSymbol>( u"line_annotation_item"_s );
196 if ( !lineSymbol )
197 lineSymbol.reset( qgis::down_cast<QgsLineSymbol *>( QgsSymbol::defaultSymbol( Qgis::GeometryType::Line ) ) );
198 createdItem->setSymbol( lineSymbol.release() );
199
200 // set reference scale to match canvas scale, but don't enable it by default for marker items
201 createdItem->setSymbologyReferenceScale( canvas()->scale() );
202
203 mHandler->pushCreatedItem( createdItem.release() );
204 }
205}
206
207//
208// QgsCreatePolygonItemMapTool
209//
210
212 : QgsMapToolCaptureAnnotationItem( canvas, cadDockWidget, CapturePolygon )
213{
214 mHandler = new QgsCreateAnnotationItemMapToolHandler( canvas, cadDockWidget, this );
215}
216
217void QgsCreatePolygonItemMapTool::polygonCaptured( const QgsCurvePolygon *polygon )
218{
219 if ( polygon->isEmpty() )
220 return;
221
222 std::unique_ptr<QgsAbstractGeometry> geometry( polygon->exteriorRing()->simplifiedTypeRef()->clone() );
223 if ( qgsgeometry_cast<QgsCurve *>( geometry.get() ) )
224 {
225 auto newPolygon = std::make_unique<QgsCurvePolygon>();
226 newPolygon->setExteriorRing( qgis::down_cast<QgsCurve *>( geometry.release() ) );
227 auto createdItem = std::make_unique<QgsAnnotationPolygonItem>( newPolygon.release() );
228
229 std::unique_ptr<QgsFillSymbol> fillSymbol = QgsApplication::recentStyleHandler()->recentSymbol<QgsFillSymbol>( u"polygon_annotation_item"_s );
230 if ( !fillSymbol )
231 fillSymbol.reset( qgis::down_cast<QgsFillSymbol *>( QgsSymbol::defaultSymbol( Qgis::GeometryType::Polygon ) ) );
232 createdItem->setSymbol( fillSymbol.release() );
233
234 // set reference scale to match canvas scale, but don't enable it by default for marker items
235 createdItem->setSymbologyReferenceScale( canvas()->scale() );
236
237 mHandler->pushCreatedItem( createdItem.release() );
238 }
239}
240
241
242//
243// QgsCreatePictureItemMapTool
244//
245
246const QgsSettingsEntryString *QgsCreatePictureItemMapTool::settingLastSourceFolder = new QgsSettingsEntryString( u"last-source-folder"_s, sTreePicture, QString(), u"Last used folder for picture annotation source files"_s );
247
249 : QgsMapToolAdvancedDigitizing( canvas, cadDockWidget )
250 , mHandler( new QgsCreateAnnotationItemMapToolHandler( canvas, cadDockWidget, this ) )
251{
252 setUseSnappingIndicator( true );
253}
254
256{
257 if ( event->button() == Qt::RightButton && mRubberBand )
258 {
259 mRubberBand.reset();
261 return;
262 }
263
264 if ( event->button() != Qt::LeftButton )
265 return;
266
267 if ( !mRubberBand )
268 {
269 mFirstPoint = event->snapPoint();
270 mRect.setRect( mFirstPoint.x(), mFirstPoint.y(), mFirstPoint.x(), mFirstPoint.y() );
271
272 mRubberBand.reset( new QgsRubberBand( mCanvas, Qgis::GeometryType::Polygon ) );
273 mRubberBand->setWidth( digitizingStrokeWidth() );
274 QColor color = digitizingStrokeColor();
275
277 color.setAlphaF( color.alphaF() * alphaScale );
278 mRubberBand->setLineStyle( Qt::DotLine );
279 mRubberBand->setStrokeColor( color );
280
281 const QColor fillColor = digitizingFillColor();
282 mRubberBand->setFillColor( fillColor );
283 }
284 else
285 {
286 mRubberBand.reset();
287
288 QStringList formatsFilter;
289 formatsFilter.append( u"*.svg"_s );
290 const QByteArrayList supportedFormats = QImageReader::supportedImageFormats();
291 for ( const auto &format : supportedFormats )
292 {
293 formatsFilter.append( QString( u"*.%1"_s ).arg( QString( format ) ) );
294 }
295 const QString dialogFilter = u"%1 (%2);;%3 (*.*)"_s.arg( tr( "Images" ), formatsFilter.join( ' '_L1 ), tr( "All files" ) );
296 const QString initialDir = settingLastSourceFolder->value();
297 const QString imagePath = QFileDialog::getOpenFileName( nullptr, tr( "Add Picture Annotation" ), initialDir.isEmpty() ? QDir::homePath() : initialDir, dialogFilter );
298
299 if ( imagePath.isEmpty() )
300 {
301 return; //canceled by the user
302 }
303
304 settingLastSourceFolder->setValue( QFileInfo( imagePath ).path() );
305
306 const QgsPointXY point1 = toLayerCoordinates( mHandler->targetLayer(), mFirstPoint );
307 const QgsPointXY point2 = toLayerCoordinates( mHandler->targetLayer(), event->snapPoint() );
308
309 const QgsPointXY devicePoint1 = toCanvasCoordinates( mFirstPoint );
310 const QgsPointXY devicePoint2 = toCanvasCoordinates( event->snapPoint() );
311 const double initialWidthPixels = std::abs( devicePoint1.x() - devicePoint2.x() );
312 const double initialHeightPixels = std::abs( devicePoint1.y() - devicePoint2.y() );
313
314 const QFileInfo pathInfo( imagePath );
316
317 QSizeF size;
318 if ( pathInfo.suffix().compare( "svg"_L1, Qt::CaseInsensitive ) == 0 )
319 {
321 size = QgsApplication::svgCache()->svgViewboxSize( imagePath, 100, QColor(), QColor(), 1, 1 );
322 }
323 else
324 {
326 size = QgsApplication::imageCache()->originalSize( imagePath );
327 }
328
330
331 auto createdItem = std::make_unique<QgsAnnotationPictureItem>( format, imagePath, QgsRectangle( point1, point2 ) );
332 if ( size.isValid() )
333 {
334 const double pixelsToMm = mCanvas->mapSettings().outputDpi() / 25.4;
335 if ( size.width() / size.height() > initialWidthPixels / initialHeightPixels )
336 {
337 createdItem->setFixedSize( QSizeF( initialWidthPixels / pixelsToMm, size.height() / size.width() * initialWidthPixels / pixelsToMm ) );
338 }
339 else
340 {
341 createdItem->setFixedSize( QSizeF( size.width() / size.height() * initialHeightPixels / pixelsToMm, initialHeightPixels / pixelsToMm ) );
342 }
343 createdItem->setFixedSizeUnit( Qgis::RenderUnit::Millimeters );
344 }
345
346 mHandler->pushCreatedItem( createdItem.release() );
347 }
348}
349
351{
352 if ( !mRubberBand )
353 return;
354
355 const QgsPointXY mapPoint = event->snapPoint();
356 mRect.setBottomRight( mapPoint.toQPointF() );
357
358 mRubberBand->reset( Qgis::GeometryType::Polygon );
359 mRubberBand->addPoint( mRect.bottomLeft(), false );
360 mRubberBand->addPoint( mRect.bottomRight(), false );
361 mRubberBand->addPoint( mRect.topRight(), false );
362 mRubberBand->addPoint( mRect.topLeft(), true );
363}
364
365void QgsCreatePictureItemMapTool::keyPressEvent( QKeyEvent *event )
366{
367 if ( event->key() == Qt::Key_Escape )
368 {
369 if ( mRubberBand )
370 {
371 mRubberBand.reset();
373 event->ignore();
374 }
375 }
376}
377
379{
380 return mHandler;
381}
382
384{
385 return this;
386}
387
388
389//
390// QgsCreateRectangleTextItemMapTool
391//
392
394 : QgsMapToolAdvancedDigitizing( canvas, cadDockWidget )
395 , mHandler( new QgsCreateAnnotationItemMapToolHandler( canvas, cadDockWidget, this ) )
396{
397 setUseSnappingIndicator( true );
398}
399
401{
402 if ( event->button() == Qt::RightButton && mRubberBand )
403 {
404 mRubberBand.reset();
406 return;
407 }
408
409 if ( event->button() != Qt::LeftButton )
410 return;
411
412 if ( !mRubberBand )
413 {
414 mFirstPoint = event->snapPoint();
415 mRect.setRect( mFirstPoint.x(), mFirstPoint.y(), mFirstPoint.x(), mFirstPoint.y() );
416
417 mRubberBand.reset( new QgsRubberBand( mCanvas, Qgis::GeometryType::Polygon ) );
418 mRubberBand->setWidth( digitizingStrokeWidth() );
419 QColor color = digitizingStrokeColor();
420
422 color.setAlphaF( color.alphaF() * alphaScale );
423 mRubberBand->setLineStyle( Qt::DotLine );
424 mRubberBand->setStrokeColor( color );
425
426 const QColor fillColor = digitizingFillColor();
427 mRubberBand->setFillColor( fillColor );
428 }
429 else
430 {
431 mRubberBand.reset();
432
433 const QgsPointXY point1 = toLayerCoordinates( mHandler->targetLayer(), mFirstPoint );
434 const QgsPointXY point2 = toLayerCoordinates( mHandler->targetLayer(), event->snapPoint() );
435
437
438 auto createdItem = std::make_unique<QgsAnnotationRectangleTextItem>( tr( "Text" ), QgsRectangle( point1, point2 ) );
439
441 // default to HTML formatting
442 format.setAllowHtmlFormatting( true );
443 createdItem->setFormat( format );
444
445 // newly created rect text items default to using symbology reference scale at the current map scale
446 createdItem->setUseSymbologyReferenceScale( true );
447 createdItem->setSymbologyReferenceScale( canvas()->scale() );
448 mHandler->pushCreatedItem( createdItem.release() );
449 }
450}
451
453{
454 if ( !mRubberBand )
455 return;
456
457 const QgsPointXY mapPoint = event->snapPoint();
458 mRect.setBottomRight( mapPoint.toQPointF() );
459
460 mRubberBand->reset( Qgis::GeometryType::Polygon );
461 mRubberBand->addPoint( mRect.bottomLeft(), false );
462 mRubberBand->addPoint( mRect.bottomRight(), false );
463 mRubberBand->addPoint( mRect.topRight(), false );
464 mRubberBand->addPoint( mRect.topLeft(), true );
465}
466
468{
469 if ( event->key() == Qt::Key_Escape )
470 {
471 if ( mRubberBand )
472 {
473 mRubberBand.reset();
475 event->ignore();
476 }
477 }
478}
479
481{
482 return mHandler;
483}
484
486{
487 return this;
488}
489
490
491//
492// QgsCreateLineTextItemMapTool
493//
494
496 : QgsMapToolCaptureAnnotationItem( canvas, cadDockWidget, CaptureLine )
497{
498 mHandler = new QgsCreateAnnotationItemMapToolHandler( canvas, cadDockWidget, this );
499}
500
501void QgsCreateLineTextItemMapTool::lineCaptured( const QgsCurve *line )
502{
503 if ( line->isEmpty() )
504 return;
505
506 // do it!
507 std::unique_ptr<QgsAbstractGeometry> geometry( line->simplifiedTypeRef()->clone() );
508 if ( qgsgeometry_cast<QgsCurve *>( geometry.get() ) )
509 {
510 auto createdItem = std::make_unique<QgsAnnotationLineTextItem>( tr( "Text" ), qgis::down_cast<QgsCurve *>( geometry.release() ) );
511
512 std::unique_ptr<QgsLineSymbol> lineSymbol = QgsApplication::recentStyleHandler()->recentSymbol<QgsLineSymbol>( u"line_annotation_item"_s );
513 if ( !lineSymbol )
514 lineSymbol.reset( qgis::down_cast<QgsLineSymbol *>( QgsSymbol::defaultSymbol( Qgis::GeometryType::Line ) ) );
515
517 // default to HTML formatting
518 format.setAllowHtmlFormatting( true );
519 createdItem->setFormat( format );
520
521 // newly created point text items default to using symbology reference scale at the current map scale
522 createdItem->setUseSymbologyReferenceScale( true );
523 createdItem->setSymbologyReferenceScale( canvas()->scale() );
524 mHandler->pushCreatedItem( createdItem.release() );
525 }
526}
527
CaptureTechnique
Capture technique.
Definition qgis.h:404
@ NurbsCurve
Digitizes NURBS curves with control points.
Definition qgis.h:409
@ Shape
Digitize shapes.
Definition qgis.h:408
@ StraightSegments
Default capture mode - capture occurs with straight line segments.
Definition qgis.h:405
@ CircularString
Capture in circular strings.
Definition qgis.h:406
@ Streaming
Streaming points digitizing mode (points are automatically added as the mouse cursor moves).
Definition qgis.h:407
PictureFormat
Picture formats.
Definition qgis.h:5344
@ Raster
Raster image.
Definition qgis.h:5346
@ Unknown
Invalid or unknown image type.
Definition qgis.h:5347
@ SVG
SVG image.
Definition qgis.h:5345
@ Point
Points.
Definition qgis.h:366
@ Line
Lines.
Definition qgis.h:367
@ Polygon
Polygons.
Definition qgis.h:368
@ Millimeters
Millimeters.
Definition qgis.h:5256
virtual const QgsAbstractGeometry * simplifiedTypeRef() const
Returns a reference to the simplest lossless representation of this geometry, e.g.
virtual bool isEmpty() const
Returns true if the geometry is empty.
virtual QgsAbstractGeometry * clone() const =0
Clones the geometry by performing a deep copy.
A dockable widget used to handle the CAD tools on top of a selection of map tools.
void clearPoints()
Removes all points from the CAD point list.
static QgsRecentStyleHandler * recentStyleHandler()
Returns the handler for recently used style items.
static QgsImageCache * imageCache()
Returns the application's image cache, used for caching resampled versions of raster images.
static QgsSvgCache * svgCache()
Returns the application's SVG cache, used for caching SVG images and handling parameter replacement w...
A handler object for map tools which create annotation items.
QgsCreateLineItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
QgsCreateLineTextItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
QgsCreateMarkerItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
void cadCanvasReleaseEvent(QgsMapMouseEvent *event) override
Override this method when subclassing this class.
void cadCanvasMoveEvent(QgsMapMouseEvent *event) override
Override this method when subclassing this class.
static const QgsSettingsEntryString * settingLastSourceFolder
QgsCreateAnnotationItemMapToolHandler * handler() const override
Returns the handler object for the map tool.
void cadCanvasPressEvent(QgsMapMouseEvent *event) override
Override this method when subclassing this class.
void keyPressEvent(QKeyEvent *event) override
Key event for overriding. Default implementation does nothing.
QgsCreatePictureItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
QgsMapTool * mapTool() override
Returns a reference to the associated map tool.
~QgsCreatePointTextItemMapTool() override
QgsMapTool * mapTool() override
Returns a reference to the associated map tool.
void cadCanvasPressEvent(QgsMapMouseEvent *event) override
Override this method when subclassing this class.
QgsCreatePointTextItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
QgsCreateAnnotationItemMapToolHandler * handler() const override
Returns the handler object for the map tool.
QgsCreatePolygonItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
QgsCreateRectangleTextItemMapTool(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Constructor.
QgsMapTool * mapTool() override
Returns a reference to the associated map tool.
void cadCanvasMoveEvent(QgsMapMouseEvent *event) override
Override this method when subclassing this class.
void cadCanvasPressEvent(QgsMapMouseEvent *event) override
Override this method when subclassing this class.
void keyPressEvent(QKeyEvent *event) override
Key event for overriding. Default implementation does nothing.
QgsCreateAnnotationItemMapToolHandler * handler() const override
Returns the handler object for the map tool.
Curve polygon geometry type.
const QgsCurve * exteriorRing() const
Returns the curve polygon's exterior ring.
bool isEmpty() const override
Returns true if the geometry is empty.
Abstract base class for curved geometry type.
Definition qgscurve.h:36
QSize originalSize(const QString &path, bool blocking=false) const
Returns the original size (in pixels) of the image at the specified path.
Map canvas is a class for displaying all GIS data types on a canvas.
Base class for all map layer types.
Definition qgsmaplayer.h:83
A mouse event which is the result of a user interaction with a QgsMapCanvas.
QgsPointXY mapPoint() const
mapPoint returns the point in coordinates
QgsPointXY snapPoint()
snapPoint will snap the points using the map canvas snapping utils configuration
A QgsMapTool which gives events directly in map coordinates and allows filtering of events.
QgsAdvancedDigitizingDockWidget * cadDockWidget() const
A base class to digitize annotation items using QgsMapToolCapture.
QgsMapToolCaptureAnnotationItem(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget, CaptureMode mode)
Constructor.
QgsMapTool * mapTool() override
Returns a reference to the associated map tool.
bool supportsTechnique(Qgis::CaptureTechnique technique) const override
Returns true if the tool supports the specified capture technique.
QgsMapLayer * layer() const override
Returns the layer associated with the map tool.
QgsCreateAnnotationItemMapToolHandler * mHandler
QgsMapToolCapture::Capabilities capabilities() const override
Returns flags containing the supported capabilities.
QgsCreateAnnotationItemMapToolHandler * handler() const override
Returns the handler object for the map tool.
Base class for map tools capable of capturing point, lines and polygons.
void stopCapturing()
Stop capturing.
QFlags< Capability > Capabilities
@ SupportsCurves
Supports curved geometries input.
static QColor digitizingFillColor()
Returns fill color for rubber bands (from global settings).
static QColor digitizingStrokeColor()
Returns stroke color for rubber bands (from global settings).
static int digitizingStrokeWidth()
Returns stroke width for rubber bands (from global settings).
Abstract base class for all map tools.
Definition qgsmaptool.h:72
QgsPoint toLayerCoordinates(const QgsMapLayer *layer, const QgsPoint &point)
Transforms a point from map coordinates to layer coordinates.
QgsMapCanvas * canvas() const
returns pointer to the tool's map canvas
QPointer< QgsMapCanvas > mCanvas
The pointer to the map canvas.
Definition qgsmaptool.h:360
QPoint toCanvasCoordinates(const QgsPointXY &point) const
Transforms a point from map coordinates to screen coordinates.
double y
Definition qgspointxy.h:66
double x
Definition qgspointxy.h:65
QPointF toQPointF() const
Converts a point to a QPointF.
Definition qgspointxy.h:167
static QgsProject * instance()
Returns the QgsProject singleton instance.
QgsSymbol * recentSymbol(const QString &identifier) const
Returns a copy of the recently used symbol with the specified identifier, or nullptr if no symbol wit...
T value(const QString &dynamicKeyPart=QString()) const
Returns settings value.
A string settings entry.
static const QgsSettingsEntryDouble * settingsDigitizingLineColorAlphaScale
Settings entry digitizing line color alpha scale.
static QgsTextFormat defaultTextFormatForProject(QgsProject *project, QgsStyle::TextFormatContext context=QgsStyle::TextFormatContext::Labeling)
Returns the default text format to use for new text based objects for the specified project,...
@ Labeling
Text format used in labeling.
Definition qgsstyle.h:813
QSizeF svgViewboxSize(const QString &path, double size, const QColor &fill, const QColor &stroke, double strokeWidth, double widthScaleFactor, double fixedAspectRatio=0, bool blocking=false, const QMap< QString, QString > &parameters=QMap< QString, QString >())
Calculates the viewbox size of a (possibly cached) SVG file.
static QgsSymbol * defaultSymbol(Qgis::GeometryType geomType)
Returns a new default symbol for the specified geometry type.
void setAllowHtmlFormatting(bool allow)
Sets whether text should be treated as a HTML document and HTML tags should be used for formatting th...
#define BUILTIN_UNREACHABLE
Definition qgis.h:7489
T qgsgeometry_cast(QgsAbstractGeometry *geom)