QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsquickmapsettings.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsquickmapsettings.cpp
3  --------------------------------------
4  Date : 27.12.2014
5  Copyright : (C) 2014 by Matthias Kuhn
6  Email : matthias (at) opengis.ch
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 
17 #include "qgis.h"
18 #include "qgsquickmapsettings.h"
19 
20 #include "qgsmaplayer.h"
22 #include "qgsmessagelog.h"
23 #include "qgsproject.h"
24 #include "qgsprojectviewsettings.h"
25 
27  : QObject( parent )
28 {
29  // Connect signals for derived values
36 }
37 
39 {
40  if ( project == mProject )
41  return;
42 
43  // If we have already something connected, disconnect it!
44  if ( mProject )
45  {
46  mProject->disconnect( this );
47  }
48 
49  mProject = project;
50 
51  // Connect all signals
52  if ( mProject )
53  {
54  connect( mProject, &QgsProject::readProject, this, &QgsQuickMapSettings::onReadProject );
55  connect( mProject, &QgsProject::crsChanged, this, &QgsQuickMapSettings::onCrsChanged );
56  setDestinationCrs( mProject->crs() );
57  mMapSettings.setTransformContext( mProject->transformContext() );
58  mMapSettings.setPathResolver( mProject->pathResolver() );
59  }
60  else
61  {
63  }
64 
65  emit projectChanged();
66 }
67 
69 {
70  return mProject;
71 }
72 
74 {
75  return mMapSettings.transformContext();
76 }
77 
79 {
80  return mMapSettings.extent();
81 }
82 
84 {
85  if ( mMapSettings.extent() == extent )
86  return;
87 
88  mMapSettings.setExtent( extent );
89  emit extentChanged();
90 }
91 
93 {
94  QgsVector delta = QgsPointXY( center ) - mMapSettings.extent().center();
95 
96  QgsRectangle e = mMapSettings.extent();
97  e.setXMinimum( e.xMinimum() + delta.x() );
98  e.setXMaximum( e.xMaximum() + delta.x() );
99  e.setYMinimum( e.yMinimum() + delta.y() );
100  e.setYMaximum( e.yMaximum() + delta.y() );
101 
102  setExtent( e );
103 }
104 
106 {
107  return mMapSettings.mapUnitsPerPixel();
108 }
109 
110 void QgsQuickMapSettings::setCenterToLayer( QgsMapLayer *layer, bool shouldZoom )
111 {
112  Q_ASSERT( layer );
113 
114  const QgsRectangle extent = mapSettings().layerToMapCoordinates( layer, layer->extent() );
115 
116  if ( !extent.isEmpty() )
117  {
118  if ( shouldZoom )
119  setExtent( extent );
120  else
122  }
123 }
124 
126 {
127  return mMapSettings.mapUnitsPerPixel() * devicePixelRatio();
128 }
129 
131 {
132  return mMapSettings.visibleExtent();
133 }
134 
136 {
137  QgsPointXY pt( point.x(), point.y() );
138  QgsPointXY pp = mMapSettings.mapToPixel().transform( pt );
139  pp.setX( pp.x() / devicePixelRatio() );
140  pp.setY( pp.y() / devicePixelRatio() );
141  return pp.toQPointF();
142 }
143 
145 {
146  const QgsPointXY pp = mMapSettings.mapToPixel().toMapCoordinates( point.x() * devicePixelRatio(), point.y() * devicePixelRatio() );
147  return QgsPoint( pp );
148 }
149 
151 {
152  mMapSettings.setTransformContext( ctx );
153 }
154 
156 {
157  return mMapSettings;
158 }
159 
161 {
162  return mMapSettings.outputSize();
163 }
164 
165 void QgsQuickMapSettings::setOutputSize( QSize outputSize )
166 {
167  outputSize.setWidth( outputSize.width() * devicePixelRatio() );
168  outputSize.setHeight( outputSize.height() * devicePixelRatio() );
169  if ( mMapSettings.outputSize() == outputSize )
170  return;
171 
172  mMapSettings.setOutputSize( outputSize );
173  emit outputSizeChanged();
174 }
175 
176 double QgsQuickMapSettings::outputDpi() const
177 {
178  return mMapSettings.outputDpi();
179 }
180 
181 void QgsQuickMapSettings::setOutputDpi( double outputDpi )
182 {
184  if ( qgsDoubleNear( mMapSettings.outputDpi(), outputDpi ) )
185  return;
186 
187  mMapSettings.setOutputDpi( outputDpi );
188  emit outputDpiChanged();
189 }
190 
192 {
193  return mMapSettings.destinationCrs();
194 }
195 
197 {
198  if ( mMapSettings.destinationCrs() == destinationCrs )
199  return;
200 
201  mMapSettings.setDestinationCrs( destinationCrs );
202  emit destinationCrsChanged();
203 }
204 
205 QList<QgsMapLayer *> QgsQuickMapSettings::layers() const
206 {
207  return mMapSettings.layers();
208 }
209 
210 void QgsQuickMapSettings::setLayers( const QList<QgsMapLayer *> &layers )
211 {
212  mMapSettings.setLayers( layers );
213  emit layersChanged();
214 }
215 
216 void QgsQuickMapSettings::onCrsChanged()
217 {
218  setDestinationCrs( mProject->crs() );
219 }
220 
221 void QgsQuickMapSettings::onReadProject( const QDomDocument &doc )
222 {
223  if ( mProject )
224  {
225  int red = mProject->readNumEntry( QStringLiteral( "Gui" ), QStringLiteral( "/CanvasColorRedPart" ), 255 );
226  int green = mProject->readNumEntry( QStringLiteral( "Gui" ), QStringLiteral( "/CanvasColorGreenPart" ), 255 );
227  int blue = mProject->readNumEntry( QStringLiteral( "Gui" ), QStringLiteral( "/CanvasColorBluePart" ), 255 );
228  mMapSettings.setBackgroundColor( QColor( red, green, blue ) );
229  }
230 
231  QDomNodeList nodes = doc.elementsByTagName( "mapcanvas" );
232  bool foundTheMapCanvas = false;
233  for ( int i = 0; i < nodes.size(); i++ )
234  {
235  QDomNode node = nodes.item( 0 );
236  QDomElement element = node.toElement();
237 
238  if ( element.hasAttribute( QStringLiteral( "name" ) ) && element.attribute( QStringLiteral( "name" ) ) == QLatin1String( "theMapCanvas" ) )
239  {
240  foundTheMapCanvas = true;
241  mMapSettings.readXml( node );
242 
243  if ( !qgsDoubleNear( mMapSettings.rotation(), 0 ) )
244  QgsMessageLog::logMessage( tr( "Map Canvas rotation is not supported. Resetting from %1 to 0." ).arg( mMapSettings.rotation() ) );
245  }
246  }
247  if ( !foundTheMapCanvas )
248  {
249  mMapSettings.setDestinationCrs( mProject->crs() );
250  mMapSettings.setExtent( mProject->viewSettings()->fullExtent() );
251  }
252 
253  mMapSettings.setRotation( 0 );
254 
255  mMapSettings.setTransformContext( mProject->transformContext() );
256  mMapSettings.setPathResolver( mProject->pathResolver() );
257 
258  emit extentChanged();
259  emit destinationCrsChanged();
260  emit outputSizeChanged();
261  emit outputDpiChanged();
262  emit layersChanged();
263 }
264 
265 double QgsQuickMapSettings::rotation() const
266 {
267  return mMapSettings.rotation();
268 }
269 
270 void QgsQuickMapSettings::setRotation( double rotation )
271 {
272  if ( !qgsDoubleNear( rotation, 0 ) )
273  QgsMessageLog::logMessage( tr( "Map Canvas rotation is not supported. Resetting from %1 to 0." ).arg( rotation ) );
274 }
275 
277 {
278  return mMapSettings.backgroundColor();
279 }
280 
281 void QgsQuickMapSettings::setBackgroundColor( const QColor &color )
282 {
283  if ( mMapSettings.backgroundColor() == color )
284  return;
285 
286  mMapSettings.setBackgroundColor( color );
287  emit backgroundColorChanged();
288 }
289 
291 {
292  return mDevicePixelRatio;
293 }
294 
295 void QgsQuickMapSettings::setDevicePixelRatio( const qreal &devicePixelRatio )
296 {
297  mDevicePixelRatio = devicePixelRatio;
299 }
QgsMapSettings::setDestinationCrs
void setDestinationCrs(const QgsCoordinateReferenceSystem &crs)
Sets the destination crs (coordinate reference system) for the map render.
Definition: qgsmapsettings.cpp:350
QgsPointXY::y
double y
Definition: qgspointxy.h:63
qgsmaplayerstylemanager.h
QgsQuickMapSettings::setExtent
void setExtent(const QgsRectangle &extent)
Sets the coordinates of the rectangle which should be rendered.
Definition: qgsquickmapsettings.cpp:83
QgsCoordinateTransformContext
Contains information about the context in which a coordinate transform is executed.
Definition: qgscoordinatetransformcontext.h:57
QgsProject::viewSettings
const QgsProjectViewSettings * viewSettings() const
Returns the project's view settings, which contains settings and properties relating to how a QgsProj...
Definition: qgsproject.cpp:3491
QgsQuickMapSettings::extentChanged
void extentChanged()
Geographical coordinates of the rectangle that should be rendered.
QgsMapSettings::readXml
void readXml(QDomNode &node)
Definition: qgsmapsettings.cpp:748
QgsQuickMapSettings::destinationCrsChanged
void destinationCrsChanged()
CRS of destination coordinate reference system.
QgsMapSettings::outputSize
QSize outputSize() const
Returns the size of the resulting map image, in pixels.
Definition: qgsmapsettings.cpp:239
QgsMapSettings::setRotation
void setRotation(double rotation)
Sets the rotation of the resulting map image, in degrees clockwise.
Definition: qgsmapsettings.cpp:107
QgsPoint
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:48
QgsQuickMapSettings::visibleExtent
QgsRectangle visibleExtent
Returns the actual extent derived from requested extent that takes output image size into account.
Definition: qgsquickmapsettings.h:70
QgsQuickMapSettings::outputDpi
double outputDpi
Output DPI used for conversion between real world units (e.g.
Definition: qgsquickmapsettings.h:101
QgsQuickMapSettings::mapUnitsPerPixel
double mapUnitsPerPixel
Returns the distance in geographical coordinates that equals to one pixel in the map.
Definition: qgsquickmapsettings.h:72
QgsRectangle::center
QgsPointXY center() const SIP_HOLDGIL
Returns the center point of the rectangle.
Definition: qgsrectangle.h:251
QgsQuickMapSettings::project
QgsProject project
A project property should be used as a primary source of project all other components in the applicat...
Definition: qgsquickmapsettings.h:58
QgsQuickMapSettings::projectChanged
void projectChanged()
A project property should be used as a primary source of project all other components in the applicat...
QgsQuickMapSettings::mapUnitsPerPoint
double mapUnitsPerPoint
Returns the distance in geographical coordinates that equals to one point unit in the map.
Definition: qgsquickmapsettings.h:74
QgsProject::pathResolver
QgsPathResolver pathResolver() const
Returns path resolver object with considering whether the project uses absolute or relative paths and...
Definition: qgsproject.cpp:3094
QgsRectangle::yMinimum
double yMinimum() const SIP_HOLDGIL
Returns the y minimum value (bottom side of rectangle).
Definition: qgsrectangle.h:198
QgsPointXY::setY
void setY(double y) SIP_HOLDGIL
Sets the y value of the point.
Definition: qgspointxy.h:132
QgsProject::transformContext
QgsCoordinateTransformContext transformContext
Definition: qgsproject.h:110
QgsMapSettings::mapUnitsPerPixel
double mapUnitsPerPixel() const
Returns the distance in geographical coordinates that equals to one pixel in the map.
Definition: qgsmapsettings.cpp:453
qgis.h
QgsPointXY::toQPointF
QPointF toQPointF() const
Converts a point to a QPointF.
Definition: qgspointxy.h:169
QgsProject::readProject
void readProject(const QDomDocument &)
Emitted when a project is being read.
QgsQuickMapSettings::QgsQuickMapSettings
QgsQuickMapSettings(QObject *parent=nullptr)
Create new map settings.
Definition: qgsquickmapsettings.cpp:26
QgsQuickMapSettings::setRotation
void setRotation(double rotation)
The rotation of the resulting map image, in degrees clockwise.
Definition: qgsquickmapsettings.cpp:270
QgsMapSettings::setOutputDpi
void setOutputDpi(double dpi)
Sets the dpi (dots per inch) used for conversion between real world units (e.g.
Definition: qgsmapsettings.cpp:272
QgsQuickMapSettings::coordinateToScreen
Q_INVOKABLE QPointF coordinateToScreen(const QgsPoint &point) const
Convert a map coordinate to screen pixel coordinates.
Definition: qgsquickmapsettings.cpp:135
QgsMapToPixel::toMapCoordinates
QgsPointXY toMapCoordinates(int x, int y) const
Transforms device coordinates to map (world) coordinates.
Definition: qgsmaptopixel.h:173
QgsQuickMapSettings::mapSettings
QgsMapSettings mapSettings() const
Clone map settings.
Definition: qgsquickmapsettings.cpp:155
QgsQuickMapSettings::layersChanged
void layersChanged()
Set list of layers for map rendering.
QgsPointXY::setX
void setX(double x) SIP_HOLDGIL
Sets the x value of the point.
Definition: qgspointxy.h:122
QgsRectangle
A rectangle specified with double values.
Definition: qgsrectangle.h:41
QgsQuickMapSettings::screenToCoordinate
Q_INVOKABLE QgsPoint screenToCoordinate(const QPointF &point) const
Convert a screen coordinate to a map coordinate.
Definition: qgsquickmapsettings.cpp:144
QgsProject
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition: qgsproject.h:103
QgsQuickMapSettings::setLayers
void setLayers(const QList< QgsMapLayer * > &layers)
Sets the list of layers to render in the map.
Definition: qgsquickmapsettings.cpp:210
QgsMapSettings::extent
QgsRectangle extent() const
Returns geographical coordinates of the rectangle that should be rendered.
Definition: qgsmapsettings.cpp:75
QgsQuickMapSettings::setOutputDpi
void setOutputDpi(double outputDpi)
Sets the dpi (dots per inch) used for conversion between real world units (e.g.
Definition: qgsquickmapsettings.cpp:181
QgsRectangle::xMaximum
double xMaximum() const SIP_HOLDGIL
Returns the x maximum value (right side of rectangle).
Definition: qgsrectangle.h:183
QgsProject::crsChanged
void crsChanged()
Emitted when the CRS of the project has changed.
QgsPoint::y
double y
Definition: qgspoint.h:70
QgsQuickMapSettings::destinationCrs
QgsCoordinateReferenceSystem destinationCrs
CRS of destination coordinate reference system.
Definition: qgsquickmapsettings.h:108
QgsQuickMapSettings::outputSize
QSize outputSize
The size of the resulting map image.
Definition: qgsquickmapsettings.h:94
QgsMapSettings::setBackgroundColor
void setBackgroundColor(const QColor &color)
Sets the background color of the map.
Definition: qgsmapsettings.h:381
QgsQuickMapSettings::setDestinationCrs
void setDestinationCrs(const QgsCoordinateReferenceSystem &destinationCrs)
Sets the destination crs (coordinate reference system) for the map render.
Definition: qgsquickmapsettings.cpp:196
QgsMapSettings::transformContext
QgsCoordinateTransformContext transformContext() const
Returns the coordinate transform context, which stores various information regarding which datum tran...
Definition: qgsmapsettings.cpp:463
QgsMapSettings::rotation
double rotation() const
Returns the rotation of the resulting map image, in degrees clockwise.
Definition: qgsmapsettings.cpp:102
QgsQuickMapSettings::outputDpiChanged
void outputDpiChanged()
Output DPI used for conversion between real world units (e.g.
QgsQuickMapSettings::rotation
double rotation
The rotation of the resulting map image, in degrees clockwise.
Definition: qgsquickmapsettings.h:80
qgsDoubleNear
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
Definition: qgis.h:2265
QgsProjectViewSettings::fullExtent
QgsReferencedRectangle fullExtent() const
Returns the full extent of the project, which represents the maximal limits of the project.
Definition: qgsprojectviewsettings.cpp:73
QgsVector::x
double x() const SIP_HOLDGIL
Returns the vector's x-component.
Definition: qgsvector.h:161
QgsMapLayer::extent
virtual QgsRectangle extent() const
Returns the extent of the layer.
Definition: qgsmaplayer.cpp:305
qgsmaplayer.h
QgsQuickMapSettings::layers
QList< QgsMapLayer * > layers
Set list of layers for map rendering.
Definition: qgsquickmapsettings.h:118
QgsMapSettings::backgroundColor
QColor backgroundColor() const
Returns the background color of the map.
Definition: qgsmapsettings.h:388
QgsVector::y
double y() const SIP_HOLDGIL
Returns the vector's y-component.
Definition: qgsvector.h:170
QgsRectangle::setXMinimum
void setXMinimum(double x) SIP_HOLDGIL
Set the minimum x value.
Definition: qgsrectangle.h:151
QgsMessageLog::logMessage
static void logMessage(const QString &message, const QString &tag=QString(), Qgis::MessageLevel level=Qgis::MessageLevel::Warning, bool notifyUser=true)
Adds a message to the log instance (and creates it if necessary).
Definition: qgsmessagelog.cpp:27
QgsQuickMapSettings::setCenterToLayer
Q_INVOKABLE void setCenterToLayer(QgsMapLayer *layer, bool shouldZoom=true)
Move current map extent to have center point defined by layer. Optionally only pan to the layer if sh...
Definition: qgsquickmapsettings.cpp:110
QgsQuickMapSettings::setProject
void setProject(QgsProject *project)
A project property should be used as a primary source of project all other components in the applicat...
Definition: qgsquickmapsettings.cpp:38
QgsRectangle::xMinimum
double xMinimum() const SIP_HOLDGIL
Returns the x minimum value (left side of rectangle).
Definition: qgsrectangle.h:188
QgsMapSettings::setTransformContext
void setTransformContext(const QgsCoordinateTransformContext &context)
Sets the coordinate transform context, which stores various information regarding which datum transfo...
Definition: qgsmapsettings.cpp:473
QgsQuickMapSettings::mapUnitsPerPixelChanged
void mapUnitsPerPixelChanged()
Returns the distance in geographical coordinates that equals to one pixel in the map.
QgsQuickMapSettings::rotationChanged
void rotationChanged()
The rotation of the resulting map image, in degrees clockwise.
QgsCoordinateReferenceSystem
This class represents a coordinate reference system (CRS).
Definition: qgscoordinatereferencesystem.h:211
QgsMapToPixel::transform
QgsPointXY transform(const QgsPointXY &p) const
Transforms a point p from map (world) coordinates to device coordinates.
Definition: qgsmaptopixel.h:90
QgsRectangle::setXMaximum
void setXMaximum(double x) SIP_HOLDGIL
Set the maximum x value.
Definition: qgsrectangle.h:156
QgsMapSettings::setLayers
void setLayers(const QList< QgsMapLayer * > &layers)
Sets the list of layers to render in the map.
Definition: qgsmapsettings.cpp:327
QgsPointXY
A class to represent a 2D point.
Definition: qgspointxy.h:58
QgsMapSettings::destinationCrs
QgsCoordinateReferenceSystem destinationCrs() const
Returns the destination coordinate reference system for the map render.
Definition: qgsmapsettings.cpp:358
QgsRectangle::setYMaximum
void setYMaximum(double y) SIP_HOLDGIL
Set the maximum y value.
Definition: qgsrectangle.h:166
QgsQuickMapSettings::transformContext
Q_INVOKABLE QgsCoordinateTransformContext transformContext() const
Returns the coordinate transform context, which stores various information regarding which datum tran...
Definition: qgsquickmapsettings.cpp:73
qgsprojectviewsettings.h
QgsQuickMapSettings::outputSizeChanged
void outputSizeChanged()
The size of the resulting map image.
QgsQuickMapSettings::backgroundColorChanged
void backgroundColorChanged()
The background color used to render the map.
QgsQuickMapSettings::setDevicePixelRatio
void setDevicePixelRatio(const qreal &devicePixelRatio)
Sets the ratio between physical pixels and device-independent pixels.
Definition: qgsquickmapsettings.cpp:295
QgsRectangle::yMaximum
double yMaximum() const SIP_HOLDGIL
Returns the y maximum value (top side of rectangle).
Definition: qgsrectangle.h:193
QgsRectangle::setYMinimum
void setYMinimum(double y) SIP_HOLDGIL
Set the minimum y value.
Definition: qgsrectangle.h:161
QgsQuickMapSettings::backgroundColor
QColor backgroundColor
The background color used to render the map.
Definition: qgsquickmapsettings.h:87
QgsQuickMapSettings::devicePixelRatioChanged
void devicePixelRatioChanged()
Returns the ratio between physical pixels and device-independent pixels.
QgsMapLayer
Base class for all map layer types. This is the base class for all map layer types (vector,...
Definition: qgsmaplayer.h:72
QgsVector
A class to represent a vector. Currently no Z axis / 2.5D support is implemented.
Definition: qgsvector.h:29
QgsPointXY::x
double x
Definition: qgspointxy.h:62
QgsQuickMapSettings::setOutputSize
void setOutputSize(QSize outputSize)
Sets the size of the resulting map image, in pixels.
Definition: qgsquickmapsettings.cpp:165
QgsQuickMapSettings::devicePixelRatio
qreal devicePixelRatio() const
Returns the ratio between physical pixels and device-independent pixels.
Definition: qgsquickmapsettings.cpp:290
QgsMapSettings::setOutputSize
void setOutputSize(QSize size)
Sets the size of the resulting map image, in pixels.
Definition: qgsmapsettings.cpp:244
QgsMapSettings::outputDpi
double outputDpi() const
Returns the DPI (dots per inch) used for conversion between real world units (e.g.
Definition: qgsmapsettings.cpp:267
QgsMapSettings::setPathResolver
void setPathResolver(const QgsPathResolver &resolver)
Sets the path resolver for conversion between relative and absolute paths during rendering operations...
Definition: qgsmapsettings.h:525
QgsMapSettings
The QgsMapSettings class contains configuration for rendering of the map. The rendering itself is don...
Definition: qgsmapsettings.h:88
QgsMapSettings::visibleExtent
QgsRectangle visibleExtent() const
Returns the actual extent derived from requested extent that takes output image size into account.
Definition: qgsmapsettings.cpp:411
QgsMapSettings::layerToMapCoordinates
QgsPointXY layerToMapCoordinates(const QgsMapLayer *layer, QgsPointXY point) const
transform point coordinates from layer's CRS to output CRS
Definition: qgsmapsettings.cpp:578
QgsQuickMapSettings::extent
QgsRectangle extent
Geographical coordinates of the rectangle that should be rendered.
Definition: qgsquickmapsettings.h:68
QgsMapSettings::setExtent
void setExtent(const QgsRectangle &rect, bool magnified=true)
Sets the coordinates of the rectangle which should be rendered.
Definition: qgsmapsettings.cpp:80
QgsRectangle::isEmpty
bool isEmpty() const
Returns true if the rectangle is empty.
Definition: qgsrectangle.h:469
qgsquickmapsettings.h
QgsQuickMapSettings::visibleExtentChanged
void visibleExtentChanged()
Returns the actual extent derived from requested extent that takes output image size into account.
QgsProject::crs
QgsCoordinateReferenceSystem crs
Definition: qgsproject.h:109
QgsMapSettings::mapToPixel
const QgsMapToPixel & mapToPixel() const
Definition: qgsmapsettings.h:527
QgsPoint::x
double x
Definition: qgspoint.h:69
qgsproject.h
QgsQuickMapSettings::setBackgroundColor
void setBackgroundColor(const QColor &color)
The background color used to render the map.
Definition: qgsquickmapsettings.cpp:281
QgsQuickMapSettings::setCenter
Q_INVOKABLE void setCenter(const QgsPoint &center)
Move current map extent to have center point defined by center.
Definition: qgsquickmapsettings.cpp:92
QgsMapSettings::layers
QList< QgsMapLayer * > layers(bool expandGroupLayers=false) const
Returns the list of layers which will be rendered in the map.
Definition: qgsmapsettings.cpp:299
QgsProject::readNumEntry
int readNumEntry(const QString &scope, const QString &key, int def=0, bool *ok=nullptr) const
Reads an integer from the specified scope and key.
Definition: qgsproject.cpp:2972
QgsQuickMapSettings::setTransformContext
void setTransformContext(const QgsCoordinateTransformContext &context)
Sets the coordinate transform context, which stores various information regarding which datum transfo...
Definition: qgsquickmapsettings.cpp:150
qgsmessagelog.h