Skip to content
Permalink
Browse files
QgsFeature::setId improve documentation with a warning. fixes #44898
  • Loading branch information
lbartoletti authored and nyalldawson committed Nov 1, 2021
1 parent d6f67c6 commit 2fec04e62b13489a877bda2dccbaf8b149a1c365
Showing with 10 additions and 1 deletion.
  1. +6 −0 python/core/auto_generated/qgsfeature.sip.in
  2. +4 −1 src/core/qgsfeature.h
@@ -177,6 +177,12 @@ Sets the feature ID for this feature.
:param id: feature id

.. seealso:: :py:func:`id`

.. warning::

Feature IDs will be automatically changed whenever a feature is added to vector layer or data provider.
This method is not designed to allow a specific feature ID to be assigned to a feature which will be added to a
layer or data provider, and the results will be unpredictable
%End

QgsAttributes attributes() const;
@@ -224,7 +224,10 @@ class CORE_EXPORT QgsFeature
/**
* Sets the feature ID for this feature.
* \param id feature id
* \see id
* \see id()
* \warning Feature IDs will be automatically changed whenever a feature is added to vector layer or data provider.
* This method is not designed to allow a specific feature ID to be assigned to a feature which will be added to a
* layer or data provider, and the results will be unpredictable
*/
void setId( QgsFeatureId id );

0 comments on commit 2fec04e

Please sign in to comment.