Skip to content

Commit

Permalink
Merge pull request qgis#168 from snorfalorpagus/updateFields
Browse files Browse the repository at this point in the history
Layer fields should be updated after changes in the data provider.
  • Loading branch information
wonder-sk committed Nov 24, 2013
2 parents 2a7806b + 912a3e3 commit 68a0677
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions source/docs/pyqgis_developer_cookbook/vector.rst
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ For deletion of fields just provide a list of field indexes.
if caps & QgsVectorDataProvider.DeleteAttributes:
res = layer.dataProvider().deleteAttributes( [ 0 ] )

After adding or removing fields in the data provider the layer's fields need
to be updated because the changes are not automatically propagated.
::

layer.updateFields()

.. _editing-buffer:

Expand Down

0 comments on commit 68a0677

Please sign in to comment.