Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #9074 from m-kuhn/til
Deprecate QgsGeometry::set for usage in Python
  • Loading branch information
m-kuhn committed Feb 7, 2019
2 parents 6c1036c + 2400050 commit 32b6599
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 7 additions & 1 deletion python/core/auto_generated/geometry/qgsgeometry.sip.in
Expand Up @@ -125,14 +125,20 @@ and a deep copy. Where possible, use constGet() instead.
.. versionadded:: 3.0
%End

void set( QgsAbstractGeometry *geometry /Transfer/ );
void set( QgsAbstractGeometry *geometry /Transfer/ ) /Deprecated/;
%Docstring
Sets the underlying geometry store. Ownership of geometry is transferred.

.. note::

In QGIS 2.x this method was named setGeometry().

.. note::

This method is deprecated for usage in Python and will be removed from Python bindings with QGIS 4.
Using this method will confuse Python's memory management and type information system.
Better create a new QgsGeometry object instead.

.. seealso:: :py:func:`get`

.. seealso:: :py:func:`constGet`
Expand Down
5 changes: 4 additions & 1 deletion src/core/geometry/qgsgeometry.h
Expand Up @@ -196,12 +196,15 @@ class CORE_EXPORT QgsGeometry
* Sets the underlying geometry store. Ownership of geometry is transferred.
*
* \note In QGIS 2.x this method was named setGeometry().
* \note This method is deprecated for usage in Python and will be removed from Python bindings with QGIS 4.
* Using this method will confuse Python's memory management and type information system.
* Better create a new QgsGeometry object instead.
*
* \see get()
* \see constGet()
* \since QGIS 3.0
*/
void set( QgsAbstractGeometry *geometry SIP_TRANSFER );
void set( QgsAbstractGeometry *geometry SIP_TRANSFER ) SIP_DEPRECATED;

/**
* Returns true if the geometry is null (ie, contains no underlying geometry
Expand Down

0 comments on commit 32b6599

Please sign in to comment.