mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-16 00:03:12 -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>
|
only affects third party c++ providers, and does not affect PyQGIS scripts.</li>
|
||||||
</ul>
|
</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
|
\subsection qgis_api_break_3_0_QgsVectorLayerImport QgsVectorLayerImport
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -359,7 +359,7 @@ class QgsMapLayer : QObject
|
|||||||
/** Returns layer's spatial reference system
|
/** Returns layer's spatial reference system
|
||||||
@note This was introduced in QGIS 1.4
|
@note This was introduced in QGIS 1.4
|
||||||
*/
|
*/
|
||||||
const QgsCoordinateReferenceSystem& crs() const;
|
QgsCoordinateReferenceSystem crs() const;
|
||||||
|
|
||||||
/** Sets layer's spatial reference system */
|
/** Sets layer's spatial reference system */
|
||||||
void setCrs( const QgsCoordinateReferenceSystem& srs, bool emitSignal = true );
|
void setCrs( const QgsCoordinateReferenceSystem& srs, bool emitSignal = true );
|
||||||
|
@ -1008,7 +1008,7 @@ void QgsMapLayer::setSubLayerVisibility( const QString& name, bool vis )
|
|||||||
// NOOP
|
// NOOP
|
||||||
}
|
}
|
||||||
|
|
||||||
const QgsCoordinateReferenceSystem& QgsMapLayer::crs() const
|
QgsCoordinateReferenceSystem QgsMapLayer::crs() const
|
||||||
{
|
{
|
||||||
return mCRS;
|
return mCRS;
|
||||||
}
|
}
|
||||||
|
@ -378,8 +378,7 @@ class CORE_EXPORT QgsMapLayer : public QObject
|
|||||||
/** Returns layer's spatial reference system
|
/** Returns layer's spatial reference system
|
||||||
@note This was introduced in QGIS 1.4
|
@note This was introduced in QGIS 1.4
|
||||||
*/
|
*/
|
||||||
//TODO QGIS 3.0 - return QgsCoordinateReferenceSystem object, not reference (since they are implicitly shared)
|
QgsCoordinateReferenceSystem crs() const;
|
||||||
const QgsCoordinateReferenceSystem& crs() const;
|
|
||||||
|
|
||||||
/** Sets layer's spatial reference system */
|
/** Sets layer's spatial reference system */
|
||||||
void setCrs( const QgsCoordinateReferenceSystem& srs, bool emitSignal = true );
|
void setCrs( const QgsCoordinateReferenceSystem& srs, bool emitSignal = true );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user