QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
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"
20#include <QObject>
21#include <QVector>
22
23class QDomElement;
25class QDomDocument;
26class QgsProject;
27
35class CORE_EXPORT QgsProjectViewSettings : public QObject
36{
37 Q_OBJECT
38
39 public:
40
46 QgsProjectViewSettings( QgsProject *project = nullptr );
47
51 void reset();
52
65 QgsReferencedRectangle defaultViewExtent() const;
66
79 void setDefaultViewExtent( const QgsReferencedRectangle &extent );
80
92 QgsReferencedRectangle presetFullExtent() const;
93
105 void setPresetFullExtent( const QgsReferencedRectangle &extent );
106
119 QgsReferencedRectangle fullExtent() const;
120
130 void setMapScales( const QVector<double> &scales );
131
141 QVector<double> mapScales() const;
142
152 void setUseProjectScales( bool enabled );
153
163 bool useProjectScales() const;
164
178 double defaultRotation() const;
179
193 void setDefaultRotation( double rotation );
194
199 bool readXml( const QDomElement &element, const QgsReadWriteContext &context );
200
205 QDomElement writeXml( QDomDocument &doc, const QgsReadWriteContext &context ) const;
206
207 signals:
208
216
223
224 private:
225
226 QgsProject *mProject = nullptr;
227 QVector<double> mMapScales;
228 bool mUseProjectScales = false;
229 QgsReferencedRectangle mDefaultViewExtent;
230 QgsReferencedRectangle mPresetFullExtent;
231 double mDefaultRotation = 0;
232};
233
234#endif // QGSPROJECTVIEWSETTINGS_H
Contains settings and properties relating to how a QgsProject should be displayed inside map canvas,...
void presetFullExtentChanged()
Emitted whenever the presetFullExtent() is changed.
void mapScalesChanged()
Emitted when the list of custom project map scales changes.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:107
The class is used as a container of context for various read/write operations on other objects.
A QgsRectangle with associated coordinate reference system.