I want to receive a signal when changes have been made to a layer, regardless of the type of editing (add features, remove features, change attributes). When I receive this signal I export the layer's data to an excel sheet. I've looked at these signals:
layer.dataProvider().dataChanged
: Well, nothing seems to happen here when I start and end an editing session in the layer.
layer.attributeValueChanged
: seems to be emitted before changes are committed to the data provider. When I export to excel, the columns for edited features are shifted to the right: If the un-edited data is in columns A..D, the edited data is in columns E..H instead. Is this the "editing buffer representation"?
layer.beforeCommitChanges
: same outcome as above: edited features don't occupy the same columns as the un-edited ones.
What I want is probably something like layer.afterCommitChanges
, but I can't find anything like that. There are step-by-step signals such as committedAttributesAdded
, committedFeaturesAdded
and so on but I don't think that catching all of those is the way to go.
I'm using XlsxWriter to write the excel file. Maybe the problem is related to this choice?