Skip to content

Commit

Permalink
Dox++
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 24, 2018
1 parent cc53af2 commit eacf4ad
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions python/core/auto_generated/qgsvectorlayerutils.sip.in
Expand Up @@ -164,6 +164,16 @@ Matches the attributes in ``feature`` to the specified ``fields``.
This causes the attributes contained within the given ``feature`` to be rearranged (or in
some cases dropped) in order to match the fields and order indicated by ``fields``.

The exact behavior depends on whether or not ``feature`` has a valid fields container
set (see QgsFeature.fields()). If a fields container is set, then the names of the
feature's fields are matched to ``fields``. In this case attributes from ``feature``
will be rearranged or dropped in order to match the field names from ``fields``.

If the ``feature`` does not have a valid fields container set, then the feature's attributes
are simply truncated to match the number of fields present in ``fields`` (or if
less attributes are present in ``feature`` than in ``fields``, the feature's attributes
are padded with NULL values to match the required length).

.. versionadded:: 3.4
%End
};
Expand Down
10 changes: 10 additions & 0 deletions src/core/qgsvectorlayerutils.h
Expand Up @@ -174,6 +174,16 @@ class CORE_EXPORT QgsVectorLayerUtils
* This causes the attributes contained within the given \a feature to be rearranged (or in
* some cases dropped) in order to match the fields and order indicated by \a fields.
*
* The exact behavior depends on whether or not \a feature has a valid fields container
* set (see QgsFeature::fields()). If a fields container is set, then the names of the
* feature's fields are matched to \a fields. In this case attributes from \a feature
* will be rearranged or dropped in order to match the field names from \a fields.
*
* If the \a feature does not have a valid fields container set, then the feature's attributes
* are simply truncated to match the number of fields present in \a fields (or if
* less attributes are present in \a feature than in \a fields, the feature's attributes
* are padded with NULL values to match the required length).
*
* \since QGIS 3.4
*/
static void matchAttributesToFields( QgsFeature &feature, const QgsFields &fields );
Expand Down

0 comments on commit eacf4ad

Please sign in to comment.