Skip to content
Permalink
Browse files

Dox++

  • Loading branch information
nyalldawson committed Sep 24, 2018
1 parent cc53af2 commit eacf4adb30276668591c7ebbeab9ebf0e808b1cb
Showing with 20 additions and 0 deletions.
  1. +10 −0 python/core/auto_generated/qgsvectorlayerutils.sip.in
  2. +10 −0 src/core/qgsvectorlayerutils.h
@@ -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
};
@@ -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 );

0 comments on commit eacf4ad

Please sign in to comment.
You can’t perform that action at this time.