Skip to content
Permalink
Browse files

Dox

(cherry picked from commit 5603546)
  • Loading branch information
nyalldawson committed Nov 29, 2018
1 parent 61f98ee commit 605bf2286a931efafcd7f1fcc18d338f4af19c9a
Showing with 37 additions and 0 deletions.
  1. +18 −0 python/core/auto_generated/qgsfeature.sip.in
  2. +19 −0 src/core/qgsfeature.h
@@ -333,6 +333,24 @@ Set the feature's geometry. The feature will be valid after.
Set the feature's ``geometry``. Ownership of the geometry is transferred to the feature.
The feature will be made valid after calling this method.

This method is a shortcut for calling:
.. code-block:: python

feature.setGeometry( QgsGeometry( geometry ) )

* Example:
.. code-block:: python

# Sets a feature's geometry to a point geometry
feature.setGeometry( QgsPoint( 210, 41 ) )
print(feature.geometry())
# output: <QgsGeometry: Point (210 41)>

# Sets a feature's geometry to a line string
feature.setGeometry( QgsLineString( [ QgsPoint( 210, 41 ), QgsPoint( 301, 55 ) ] ) )
print(feature.geometry())
# output: <QgsGeometry: LineString (210 41, 301 55)>

.. seealso:: :py:func:`geometry`

.. seealso:: :py:func:`clearGeometry`
@@ -349,6 +349,25 @@ class CORE_EXPORT QgsFeature
/**
* Set the feature's \a geometry. Ownership of the geometry is transferred to the feature.
* The feature will be made valid after calling this method.
*
* This method is a shortcut for calling:
* \code{.py}
* feature.setGeometry( QgsGeometry( geometry ) )
* \endcode
*
* * Example:
* \code{.py}
* # Sets a feature's geometry to a point geometry
* feature.setGeometry( QgsPoint( 210, 41 ) )
* print(feature.geometry())
* # output: <QgsGeometry: Point (210 41)>
*
* # Sets a feature's geometry to a line string
* feature.setGeometry( QgsLineString( [ QgsPoint( 210, 41 ), QgsPoint( 301, 55 ) ] ) )
* print(feature.geometry())
* # output: <QgsGeometry: LineString (210 41, 301 55)>
* \endcode
*
* \see geometry()
* \see clearGeometry()
* \since QGIS 3.4.3

0 comments on commit 605bf22

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