QGIS API Documentation 3.99.0-Master (2fe06baccd8)
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 <QVector>
27
28class QDomElement;
30class QDomDocument;
33
41class CORE_EXPORT QgsProjectDisplaySettings : public QObject
42{
43 Q_OBJECT
44
45 public:
46
51
55 QgsProjectDisplaySettings( QObject *parent = nullptr );
56
58
62 void reset();
63
73
81
93
101
107 Qgis::CoordinateDisplayType coordinateType() const { return mCoordinateType; }
108
114 void setCoordinateType( Qgis::CoordinateDisplayType type );
115
122 Qgis::CoordinateOrder coordinateAxisOrder() const { return mCoordinateAxisOrder; }
123
130 void setCoordinateAxisOrder( Qgis::CoordinateOrder order );
131
137 QgsCoordinateReferenceSystem coordinateCustomCrs() const { return mCoordinateCustomCrs; }
138
144 void setCoordinateCustomCrs( const QgsCoordinateReferenceSystem &crs );
145
152 QgsCoordinateReferenceSystem coordinateCrs() const { return mCoordinateCrs; }
153
158 bool readXml( const QDomElement &element, const QgsReadWriteContext &context );
159
164 QDomElement writeXml( QDomDocument &doc, const QgsReadWriteContext &context ) const;
165
166 signals:
167
175
183
192
201
210
219
220 private:
221 void updateCoordinateCrs();
222
223 std::unique_ptr< QgsBearingNumericFormat > mBearingFormat;
224 std::unique_ptr< QgsGeographicCoordinateNumericFormat > mGeographicCoordinateFormat;
225
227 QgsCoordinateReferenceSystem mCoordinateCustomCrs = QgsCoordinateReferenceSystem( QStringLiteral( "EPSG:4326" ) );
228 QgsCoordinateReferenceSystem mCoordinateCrs;
230
231};
232
233#endif // QGSPROJECTDISPLAYSETTINGS_H
Provides global constants and enumerations for use throughout the application.
Definition qgis.h:56
CoordinateDisplayType
Formats for displaying coordinates.
Definition qgis.h:4452
CoordinateOrder
Order of coordinates.
Definition qgis.h:2402
@ Default
Respect the default axis ordering for the CRS, as defined in the CRS's parameters.
Definition qgis.h:2403
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