Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QgsFeature::setId improve documentation with a warning #45189

Merged
merged 1 commit into from
Sep 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions python/core/auto_generated/qgsfeature.sip.in
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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