QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgsprojectviewsettings.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsprojectviewsettings.h
3  ---------------------------
4  begin : October 2019
5  copyright : (C) 2019 by 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 #ifndef QGSPROJECTVIEWSETTINGS_H
16 #define QGSPROJECTVIEWSETTINGS_H
17 
18 #include "qgis_core.h"
19 #include "qgsreferencedgeometry.h"
20 #include <QObject>
21 #include <QVector>
22 
23 class QDomElement;
25 class QDomDocument;
26 
34 class CORE_EXPORT QgsProjectViewSettings : public QObject
35 {
36  Q_OBJECT
37 
38  public:
39 
43  QgsProjectViewSettings( QObject *parent = nullptr );
44 
48  void reset();
49 
62  QgsReferencedRectangle defaultViewExtent() const;
63 
76  void setDefaultViewExtent( const QgsReferencedRectangle &extent );
77 
87  void setMapScales( const QVector<double> &scales );
88 
98  QVector<double> mapScales() const;
99 
109  void setUseProjectScales( bool enabled );
110 
120  bool useProjectScales() const;
121 
126  bool readXml( const QDomElement &element, const QgsReadWriteContext &context );
127 
132  QDomElement writeXml( QDomDocument &doc, const QgsReadWriteContext &context ) const;
133 
134  signals:
135 
143 
144  private:
145 
146  QVector<double> mMapScales;
147  bool mUseProjectScales = false;
148  QgsReferencedRectangle mDefaultViewExtent;
149 };
150 
151 #endif // QGSPROJECTVIEWSETTINGS_H
QgsProjectViewSettings::mapScalesChanged
void mapScalesChanged()
Emitted when the list of custom project map scales changes.
QgsReadWriteContext
The class is used as a container of context for various read/write operations on other objects.
Definition: qgsreadwritecontext.h:35
QgsReferencedRectangle
A QgsRectangle with associated coordinate reference system.
Definition: qgsreferencedgeometry.h:74
QgsProjectViewSettings
Contains settings and properties relating to how a QgsProject should be displayed inside map canvas,...
Definition: qgsprojectviewsettings.h:35
qgsreferencedgeometry.h