QGIS API Documentation  3.14.0-Pi (9f7028fd23)
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 
32 class CORE_EXPORT QgsLayoutReportContext : public QObject
33 {
34 
35  Q_OBJECT
36 
37  public:
38 
43 
53  void setFeature( const QgsFeature &feature );
54 
62  QgsFeature feature() const { return mFeature; }
63 
74 
79  QgsVectorLayer *layer() const;
80 
88  void setLayer( QgsVectorLayer *layer );
89 
96  Q_DECL_DEPRECATED void setPredefinedScales( const QVector<qreal> &scales ) SIP_DEPRECATED;
97 
103  Q_DECL_DEPRECATED QVector<qreal> predefinedScales() const SIP_DEPRECATED { return mPredefinedScales; }
104 
105  signals:
106 
110  void layerChanged( QgsVectorLayer *layer );
111 
116  void changed();
117 
118  private:
119 
120  QgsLayout *mLayout = nullptr;
121 
122  QgsFeature mFeature;
123  QPointer< QgsVectorLayer > mLayer;
124 
125  // projected geometry cache
126  mutable QMap<long, QgsGeometry> mGeometryCache;
127 
128  //list of predefined scales
129  QVector<qreal> mPredefinedScales;
130 
131  friend class QgsLayoutExporter;
132  friend class TestQgsLayout;
133 
134 };
135 
136 #endif //QGSLAYOUTREPORTCONTEXT_H
137 
138 
139 
crs
const QgsCoordinateReferenceSystem & crs
Definition: qgswfsgetfeature.cpp:105
qgsfeature.h
QgsLayoutReportContext
Stores information relating to the current reporting context for a layout.
Definition: qgslayoutreportcontext.h:32
QgsLayoutReportContext::predefinedScales
Q_DECL_DEPRECATED QVector< qreal > predefinedScales() const
Returns the current list of predefined scales for use with the layout.
Definition: qgslayoutreportcontext.h:103
SIP_DEPRECATED
#define SIP_DEPRECATED
Definition: qgis_sip.h:106
QgsLayoutReportContext::feature
QgsFeature feature() const
Returns the current feature for evaluating the layout.
Definition: qgslayoutreportcontext.h:62
QgsLayoutExporter
Handles rendering and exports of layouts to various formats.
Definition: qgslayoutexporter.h:44
qgslayout.h
QgsCoordinateReferenceSystem
Definition: qgscoordinatereferencesystem.h:206
QgsGeometry
Definition: qgsgeometry.h:122
QgsLayout
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Definition: qgslayout.h:49
QgsVectorLayer
Definition: qgsvectorlayer.h:385
QgsFeature
Definition: qgsfeature.h:55
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53