QGIS API Documentation 3.99.0-Master (8e76e220402)
Loading...
Searching...
No Matches
qgsprojectdisplaysettings.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsprojectdisplaysettings.h
3 ---------------------------
4 begin : January 2020
5 copyright : (C) 2020 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 QGSPROJECTDISPLAYSETTINGS_H
16#define QGSPROJECTDISPLAYSETTINGS_H
17
18#include <memory>
19
20#include "qgis.h"
21#include "qgis_core.h"
22#include "qgis_sip.h"
24
25#include <QObject>
26#include <QString>
27#include <QVector>
28
29using namespace Qt::StringLiterals;
30
31class QDomElement;
33class QDomDocument;
36
44class CORE_EXPORT QgsProjectDisplaySettings : public QObject
45{
46 Q_OBJECT
47
48 public:
49
54
58 QgsProjectDisplaySettings( QObject *parent = nullptr );
59
61
65 void reset();
66
76
84
96
104
110 Qgis::CoordinateDisplayType coordinateType() const { return mCoordinateType; }
111
117 void setCoordinateType( Qgis::CoordinateDisplayType type );
118
125 Qgis::CoordinateOrder coordinateAxisOrder() const { return mCoordinateAxisOrder; }
126
133 void setCoordinateAxisOrder( Qgis::CoordinateOrder order );
134
140 QgsCoordinateReferenceSystem coordinateCustomCrs() const { return mCoordinateCustomCrs; }
141
147 void setCoordinateCustomCrs( const QgsCoordinateReferenceSystem &crs );
148
155 QgsCoordinateReferenceSystem coordinateCrs() const { return mCoordinateCrs; }
156
161 bool readXml( const QDomElement &element, const QgsReadWriteContext &context );
162
167 QDomElement writeXml( QDomDocument &doc, const QgsReadWriteContext &context ) const;
168
169 signals:
170
178
186
195
204
213
222
223 private:
224 void updateCoordinateCrs();
225
226 std::unique_ptr< QgsBearingNumericFormat > mBearingFormat;
227 std::unique_ptr< QgsGeographicCoordinateNumericFormat > mGeographicCoordinateFormat;
228
230 QgsCoordinateReferenceSystem mCoordinateCustomCrs = QgsCoordinateReferenceSystem( u"EPSG:4326"_s );
231 QgsCoordinateReferenceSystem mCoordinateCrs;
233
234};
235
236#endif // QGSPROJECTDISPLAYSETTINGS_H
Provides global constants and enumerations for use throughout the application.
Definition qgis.h:59
CoordinateDisplayType
Formats for displaying coordinates.
Definition qgis.h:4546
CoordinateOrder
Order of coordinates.
Definition qgis.h:2460
@ Default
Respect the default axis ordering for the CRS, as defined in the CRS's parameters.
Definition qgis.h:2461
A numeric formatter which returns a text representation of a direction/bearing.
Represents a coordinate reference system (CRS).
A numeric formatter which returns a text representation of a geographic coordinate (latitude or longi...
const QgsGeographicCoordinateNumericFormat * geographicCoordinateFormat() const
Returns the project's geographic coordinate format, which controls how geographic coordinates associa...
void geographicCoordinateFormatChanged()
Emitted when the geographic coordinate format changes.
void setCoordinateAxisOrder(Qgis::CoordinateOrder order)
Sets the default coordinate axis order to use when displaying coordinates for the project.
void setCoordinateCustomCrs(const QgsCoordinateReferenceSystem &crs)
Sets the coordinate custom CRS used when the project coordinate type is set to Qgis....
void coordinateAxisOrderChanged()
Emitted when the default coordinate axis order changes.
QgsCoordinateReferenceSystem coordinateCustomCrs
void reset()
Resets the settings to a default state.
const QgsBearingNumericFormat * bearingFormat() const
Returns the project bearing's format, which controls how bearings associated with the project are dis...
void bearingFormatChanged()
Emitted when the bearing format changes.
Qgis::CoordinateOrder coordinateAxisOrder
Qgis::CoordinateDisplayType coordinateType
QgsCoordinateReferenceSystem coordinateCrs() const
Returns the coordinate display CRS used derived from the coordinate type.
void coordinateCrsChanged()
Emitted when the coordinate CRS changes.
void coordinateTypeChanged()
Emitted when the default coordinate format changes.
QgsCoordinateReferenceSystem coordinateCrs
QgsProjectDisplaySettings(QObject *parent=nullptr)
Constructor for QgsProjectDisplaySettings with the specified parent object.
void coordinateCustomCrsChanged()
Emitted when the coordinate custom CRS changes.
void setCoordinateType(Qgis::CoordinateDisplayType type)
Sets the default coordinate type for the project.
void setGeographicCoordinateFormat(QgsGeographicCoordinateNumericFormat *format)
Sets the project geographic coordinate format, which controls how geographic coordinates associated w...
QgsCoordinateReferenceSystem coordinateCustomCrs() const
Returns the coordinate custom CRS used when the project coordinate type is set to Qgis....
Qgis::CoordinateOrder coordinateAxisOrder() const
Returns default coordinate axis order to use when displaying coordinates for the project.
void setBearingFormat(QgsBearingNumericFormat *format)
Sets the project bearing format, which controls how bearings associated with the project are displaye...
A container for the context for various read/write operations on objects.
#define SIP_TRANSFER
Definition qgis_sip.h:36