Class: QgsVectorLayerEditPassthrough

class qgis.core.QgsVectorLayerEditPassthrough(layer: QgsVectorLayer)

Bases: QgsVectorLayerEditBuffer

Methods

addAttribute

param field

addFeature

param f

addFeatures

param features

changeAttributeValue

param fid

changeAttributeValues

Changes values of attributes (but does not commit it).

changeGeometry

param fid

childEvent

commitChanges

param commitErrors

connectNotify

customEvent

deleteAttribute

param attr

deleteFeature

param fid

deleteFeatures

param fids

disconnectNotify

handleAttributeAdded

Update added and changed features after addition of an attribute

handleAttributeDeleted

Update added and changed features after removal of an attribute

isModified

rtype

bool

isSignalConnected

receivers

renameAttribute

param attr

rollBack

sender

senderSignalIndex

timerEvent

undoIndexChanged

update

Update underlying data with a SQL query embedded in a transaction.

updateAttributeMapIndex

Updates an index in an attribute map to a new value (for updates of changed attributes)

updateChangedAttributes

Update feature with uncommitted attribute updates

updateFeatureGeometry

Update feature with uncommitted geometry updates

updateLayerFields

addAttribute(self, field: QgsField)bool
Parameters

field (QgsField) –

Return type

bool

addFeature(self, f: QgsFeature)bool
Parameters

f (QgsFeature) –

Return type

bool

addFeatures(self, features: Iterable[QgsFeature])bool
Parameters

features (Iterable[QgsFeature]) –

Return type

bool

changeAttributeValue(self, fid: int, field: int, newValue: Any, oldValue: Any = None)bool
Parameters
  • fid (int) –

  • field (int) –

  • newValue (Any) –

  • oldValue (Any = None) –

Return type

bool

changeAttributeValues(self, fid: int, newValues: Dict[int, Any], oldValues: Dict[int, Any])bool

Changes values of attributes (but does not commit it).

Return type

bool

Returns

True if attributes are well updated, False otherwise

New in version 3.0.

Parameters
  • fid (int) –

  • newValues (Dict[int) –

  • oldValues (Dict[int) –

changeGeometry(self, fid: int, geom: QgsGeometry)bool
Parameters
Return type

bool

childEvent(self, QChildEvent)
commitChanges(self, commitErrors: Iterable[str])bool
Parameters

commitErrors (Iterable[str]) –

Return type

bool

connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
deleteAttribute(self, attr: int)bool
Parameters

attr (int) –

Return type

bool

deleteFeature(self, fid: int)bool
Parameters

fid (int) –

Return type

bool

deleteFeatures(self, fids: object)bool
Parameters

fids (object) –

Return type

bool

disconnectNotify(self, QMetaMethod)
handleAttributeAdded(self, index: int)

Update added and changed features after addition of an attribute

handleAttributeDeleted(self, index: int)

Update added and changed features after removal of an attribute

isModified(self)bool
Return type

bool

isSignalConnected(self, QMetaMethod)bool
receivers(self, PYQT_SIGNAL)int
renameAttribute(self, attr: int, newName: str)bool
Parameters
  • attr (int) –

  • newName (str) –

Return type

bool

rollBack(self)
sender(self)QObject
senderSignalIndex(self)int
timerEvent(self, QTimerEvent)
undoIndexChanged(self, index: int)
update(self, transaction: QgsTransaction, sql: str, name: str)bool

Update underlying data with a SQL query embedded in a transaction.

Parameters
  • transaction (QgsTransaction) – Transaction in which the sql query has been run

  • sql (str) – The SQL query updating data

  • name (str) – The name of the undo/redo command

Return type

bool

Returns

True if the undo/redo command is well added to the stack, False otherwise

New in version 3.0.

updateAttributeMapIndex(self, attrs: Dict[int, Any], index: int, offset: int)

Updates an index in an attribute map to a new value (for updates of changed attributes)

updateChangedAttributes(self, f: QgsFeature)

Update feature with uncommitted attribute updates

updateFeatureGeometry(self, f: QgsFeature)

Update feature with uncommitted geometry updates

updateLayerFields(self)