-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix changing project CRS from legend doesn't correctly set CRS
Also avoid fragile duplicated code for setting/retrieving common project properties Fixes #15717
- Loading branch information
1 parent
9a90a24
commit ecee438
Showing
31 changed files
with
255 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,38 @@ class QgsProject : QObject | |
*/ | ||
QFileInfo fileInfo() const; | ||
|
||
/** | ||
* Returns the project's native coordinate reference system. | ||
* @note added in QGIS 2.18 | ||
* @see setCrs() | ||
* @see ellipsoid() | ||
*/ | ||
QgsCoordinateReferenceSystem crs() const; | ||
|
||
/** | ||
* Sets the project's native coordinate reference system. | ||
* @note added in QGIS 2.18 | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
nyalldawson
Author
Collaborator
|
||
* @see crs() | ||
* @see setEllipsoid() | ||
*/ | ||
void setCrs( const QgsCoordinateReferenceSystem& crs ); | ||
|
||
/** | ||
* Returns a proj string representing the project's ellipsoid setting, eg "WGS84". | ||
* @see setEllipsoid() | ||
* @see crs() | ||
* @note added in QGIS 2.18 | ||
*/ | ||
QString ellipsoid() const; | ||
|
||
/** | ||
* Sets the project's ellipsoid from a proj string representation, eg "WGS84". | ||
* @see ellipsoid() | ||
* @see setCrs() | ||
* @note added in QGIS 2.18 | ||
*/ | ||
void setEllipsoid( const QString& ellipsoid ); | ||
|
||
/** Clear the project - removes all settings and resets it back to an empty, default state. | ||
* @note added in 2.4 | ||
*/ | ||
|
@@ -258,16 +290,33 @@ class QgsProject : QObject | |
|
||
/** Convenience function to query default distance measurement units for project. | ||
* @note added in QGIS 2.14 | ||
* @see setDistanceUnits() | ||
* @see areaUnits() | ||
*/ | ||
QgsUnitTypes::DistanceUnit distanceUnits() const; | ||
|
||
/** | ||
* Sets the default distance measurement units for the project. | ||
* @note added in QGIS 2.18 | ||
* @see distanceUnits() | ||
* @see setAreaUnits() | ||
*/ | ||
void setDistanceUnits( QgsUnitTypes::DistanceUnit unit ); | ||
|
||
/** Convenience function to query default area measurement units for project. | ||
* @note added in QGIS 2.14 | ||
* @see distanceUnits() | ||
*/ | ||
QgsUnitTypes::AreaUnit areaUnits() const; | ||
|
||
/** | ||
* Sets the default area measurement units for the project. | ||
* @note added in QGIS 2.18 | ||
* @see areaUnits() | ||
* @see setDistanceUnits() | ||
*/ | ||
void setAreaUnits( QgsUnitTypes::AreaUnit unit ); | ||
|
||
/** Return project's home path | ||
@return home path of project (or QString::null if not set) */ | ||
QString homePath() const; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
@nyalldawson this is not available in 2.18. Do you think I can backport to 2.18?