QGIS API Documentation  3.37.0-Master (a5b4d9743e8)
qgslayoutreportcontext.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgslayoutreportcontext.h
3  -------------------
4  begin : July 2017
5  copyright : (C) 2017 by Nyall Dawson
6  email : nyall dot dawson at gmail dot com
7  ***************************************************************************/
8 /***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 #ifndef QGSLAYOUTREPORTCONTEXT_H
17 #define QGSLAYOUTREPORTCONTEXT_H
18 
19 #include "qgis_core.h"
20 #include "qgsfeature.h"
21 #include "qgslayout.h"
22 
23 #include <QtGlobal>
24 #include <QPointer>
25 
31 class CORE_EXPORT QgsLayoutReportContext : public QObject
32 {
33 
34  Q_OBJECT
35 
36  public:
37 
42 
52  void setFeature( const QgsFeature &feature );
53 
61  QgsFeature feature() const { return mFeature; }
62 
73 
78  QgsVectorLayer *layer() const;
79 
87  void setLayer( QgsVectorLayer *layer );
88 
95  Q_DECL_DEPRECATED void setPredefinedScales( const QVector<qreal> &scales ) SIP_DEPRECATED;
96 
102  Q_DECL_DEPRECATED QVector<qreal> predefinedScales() const SIP_DEPRECATED { return mPredefinedScales; }
103 
104  signals:
105 
109  void layerChanged( QgsVectorLayer *layer );
110 
115  void changed();
116 
117  private:
118 
119  QgsLayout *mLayout = nullptr;
120 
121  QgsFeature mFeature;
122  QPointer< QgsVectorLayer > mLayer;
123 
124  // projected geometry cache
125  mutable QMap<long, QgsGeometry> mGeometryCache;
126 
127  //list of predefined scales
128  QVector<qreal> mPredefinedScales;
129 
130  friend class QgsLayoutExporter;
131  friend class TestQgsLayout;
132 
133 };
134 
135 #endif //QGSLAYOUTREPORTCONTEXT_H
136 
137 
138 
This class represents a coordinate reference system (CRS).
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition: qgsfeature.h:56
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:162
Handles rendering and exports of layouts to various formats.
Stores information relating to the current reporting context for a layout.
QgsFeature feature() const
Returns the current feature for evaluating the layout.
void layerChanged(QgsVectorLayer *layer)
Emitted when the context's layer is changed.
Q_DECL_DEPRECATED QVector< qreal > predefinedScales() const
Returns the current list of predefined scales for use with the layout.
void changed()
Emitted certain settings in the context is changed, e.g.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Definition: qgslayout.h:49
Represents a vector layer which manages a vector based data sets.
#define SIP_DEPRECATED
Definition: qgis_sip.h:106
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
const QgsCoordinateReferenceSystem & crs