mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
QgsMapLayer::crs() now returns a copy, not a reference
(desirable because QgsCoordinateReferenceSystem is implicitly shared)
This commit is contained in:
parent
a2efab0485
commit
726569c6bc
@ -41,6 +41,12 @@ objects are implicitly shared, returning a copy helps simplify and make code mor
|
||||
only affects third party c++ providers, and does not affect PyQGIS scripts.</li>
|
||||
</ul>
|
||||
|
||||
\subsection qgis_api_break_3_0_QgsMapLayer QgsMapLayer
|
||||
|
||||
<ul>
|
||||
<li>crs() now returns a QgsCoordinateReferenceSystem object, not a reference. This change has no effect for PyQGIS code.</li>
|
||||
</ul>
|
||||
|
||||
\subsection qgis_api_break_3_0_QgsVectorLayerImport QgsVectorLayerImport
|
||||
|
||||
<ul>
|
||||
|
@ -359,7 +359,7 @@ class QgsMapLayer : QObject
|
||||
/** Returns layer's spatial reference system
|
||||
@note This was introduced in QGIS 1.4
|
||||
*/
|
||||
const QgsCoordinateReferenceSystem& crs() const;
|
||||
QgsCoordinateReferenceSystem crs() const;
|
||||
|
||||
/** Sets layer's spatial reference system */
|
||||
void setCrs( const QgsCoordinateReferenceSystem& srs, bool emitSignal = true );
|
||||
|
@ -1008,7 +1008,7 @@ void QgsMapLayer::setSubLayerVisibility( const QString& name, bool vis )
|
||||
// NOOP
|
||||
}
|
||||
|
||||
const QgsCoordinateReferenceSystem& QgsMapLayer::crs() const
|
||||
QgsCoordinateReferenceSystem QgsMapLayer::crs() const
|
||||
{
|
||||
return mCRS;
|
||||
}
|
||||
|
@ -378,8 +378,7 @@ class CORE_EXPORT QgsMapLayer : public QObject
|
||||
/** Returns layer's spatial reference system
|
||||
@note This was introduced in QGIS 1.4
|
||||
*/
|
||||
//TODO QGIS 3.0 - return QgsCoordinateReferenceSystem object, not reference (since they are implicitly shared)
|
||||
const QgsCoordinateReferenceSystem& crs() const;
|
||||
QgsCoordinateReferenceSystem crs() const;
|
||||
|
||||
/** Sets layer's spatial reference system */
|
||||
void setCrs( const QgsCoordinateReferenceSystem& srs, bool emitSignal = true );
|
||||
|
Loading…
x
Reference in New Issue
Block a user