@@ -1395,6 +1395,43 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
1395
1395
*/
1396
1396
bool changeAttributeValue ( QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue = QVariant(), bool skipDefaultValues = false );
1397
1397
1398
+ /* *
1399
+ * Changes attributes' values for a feature (but does not immediately
1400
+ * commit the changes).
1401
+ * The \a fid argument specifies the ID of the feature to be changed.
1402
+ *
1403
+ * The new values to be assigned to the fields are given by \a newValues.
1404
+ *
1405
+ * If a valid QVariant is specified for a field in \a oldValues, it will be
1406
+ * used as the field value in the case of an undo operation corresponding
1407
+ * to this attribute value change. If an invalid QVariant is used (the
1408
+ * default behavior), then the feature's current value will be
1409
+ * automatically retrieved and used. Note that this involves a feature
1410
+ * request to the underlying data provider, so it is more efficient to
1411
+ * explicitly pass an oldValue if it is already available.
1412
+ *
1413
+ * If \a skipDefaultValue is set to true, default field values will not
1414
+ * be updated. This can be used to override default field value
1415
+ * expressions.
1416
+ *
1417
+ * Returns true if feature's attributes was successfully changed.
1418
+ *
1419
+ * \note Calls to changeAttributeValues() are only valid for layers in
1420
+ * which edits have been enabled by a call to startEditing(). Changes made
1421
+ * to features using this method are not committed to the underlying data
1422
+ * provider until a commitChanges() call is made. Any uncommitted changes
1423
+ * can be discarded by calling rollBack().
1424
+ *
1425
+ * \see startEditing()
1426
+ * \see commitChanges()
1427
+ * \see changeGeometry()
1428
+ * \see updateFeature()
1429
+ * \see changeAttributeValue()
1430
+ *
1431
+ * \since QGIS 3.0
1432
+ */
1433
+ bool changeAttributeValues ( QgsFeatureId fid, const QgsAttributeMap &newValues, const QgsAttributeMap &oldValues = QgsAttributeMap(), bool skeipDefaultValues = false );
1434
+
1398
1435
/* *
1399
1436
* Add an attribute field (but does not commit it)
1400
1437
* returns true if the field was added
@@ -2376,6 +2413,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
2376
2413
// ! stores information about uncommitted changes to layer
2377
2414
QgsVectorLayerEditBuffer *mEditBuffer = nullptr ;
2378
2415
friend class QgsVectorLayerEditBuffer ;
2416
+ friend class QgsVectorLayerEditPassthrough ;
2379
2417
2380
2418
// stores information about joined layers
2381
2419
QgsVectorLayerJoinBuffer *mJoinBuffer = nullptr ;
0 commit comments