Skip to content

Commit

Permalink
QgsFeature::setId improve documentation with a warning. fixes #44898
Browse files Browse the repository at this point in the history
  • Loading branch information
lbartoletti authored and nyalldawson committed Sep 22, 2021
1 parent e6b3907 commit 6562817
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python/core/auto_generated/qgsfeature.sip.in
Expand Up @@ -174,6 +174,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;
Expand Down
3 changes: 3 additions & 0 deletions src/core/qgsfeature.h
Expand Up @@ -224,6 +224,9 @@ class CORE_EXPORT QgsFeature
* Sets the feature \a id for this feature.
* \param id feature 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 );

Expand Down

0 comments on commit 6562817

Please sign in to comment.