Skip to content
Permalink
Browse files

Notify about QgsProject::crs changes

  • Loading branch information
m-kuhn committed Mar 6, 2017
1 parent c1ede00 commit 7dbe4943d606b8acd879dd6ed9e38542e3ab0bab
Showing with 13 additions and 1 deletion.
  1. +2 −0 python/core/qgsproject.sip
  2. +3 −0 src/core/qgsproject.cpp
  3. +8 −1 src/core/qgsproject.h
@@ -546,6 +546,8 @@ class QgsProject : QObject, QgsExpressionContextGenerator
*/
void customVariablesChanged();

void crsChanged();

/**
* Emitted whenever a new transaction group has been created or a
* transaction group has been removed.
@@ -433,6 +433,8 @@ void QgsProject::setCrs( const QgsCoordinateReferenceSystem &crs )
writeEntry( QStringLiteral( "SpatialRefSys" ), QStringLiteral( "/ProjectCRSID" ), static_cast< int >( crs.srsid() ) );
writeEntry( QStringLiteral( "SpatialRefSys" ), QStringLiteral( "/ProjectCrs" ), crs.authid() );
setDirty( true );

emit crsChanged();
}

QString QgsProject::ellipsoid() const
@@ -929,6 +931,7 @@ bool QgsProject::read()
setDirty( false );

emit nonIdentifiableLayersChanged( nonIdentifiableLayers() );
emit crsChanged();

return true;
}
@@ -77,7 +77,7 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera
Q_PROPERTY( QStringList nonIdentifiableLayers READ nonIdentifiableLayers WRITE setNonIdentifiableLayers NOTIFY nonIdentifiableLayersChanged )
Q_PROPERTY( QString fileName READ fileName WRITE setFileName NOTIFY fileNameChanged )
Q_PROPERTY( QString homePath READ homePath NOTIFY homePathChanged )
Q_PROPERTY( QgsCoordinateReferenceSystem crs READ crs WRITE setCrs )
Q_PROPERTY( QgsCoordinateReferenceSystem crs READ crs WRITE setCrs NOTIFY crsChanged )
Q_PROPERTY( QgsMapThemeCollection *mapThemeCollection READ mapThemeCollection NOTIFY mapThemeCollectionChanged )
Q_PROPERTY( QgsSnappingConfig snappingConfig READ snappingConfig WRITE setSnappingConfig NOTIFY snappingConfigChanged )
Q_PROPERTY( QgsRelationManager *relationManager READ relationManager )
@@ -749,6 +749,13 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera
*/
void customVariablesChanged();

/**
* Emitted when the CRS of the project has changed.
*
* @note Added in QGIS 3.0
*/
void crsChanged();

/**
* Emitted whenever a new transaction group has been created or a
* transaction group has been removed.

0 comments on commit 7dbe494

Please sign in to comment.
You can’t perform that action at this time.