Re: [Qgis-developer] wrapping changeAttributeValue between begin and end EditCommand

2015-03-16 Thread Andrew McClure
+1 for this I was unaware of the reason for the crashes on Undo I was seeing until this thread. Our approach in Telemetry Layer was to simply end the edit session and commit the changes programmatically denying the possibility of a user undo. A more elegant approach would be welcomed. On

Re: [Qgis-developer] wrapping changeAttributeValue between begin and end EditCommand

2015-03-16 Thread Luigi Pirelli
I used a different approach attaching to end Editing action to do a similar work. The logic is, start editing, do modification, stop editing is intercepted to save EditingBuffer and then roolback all modification. Then process editing buffer to create values basing on a rule and them I can

Re: [Qgis-developer] wrapping changeAttributeValue between begin and end EditCommand

2015-03-16 Thread Matthias Kuhn
On 03/16/2015 09:32 PM, Luigi Pirelli wrote: I used a different approach attaching to end Editing action to do a similar work. The logic is, start editing, do modification, stop editing is intercepted to save EditingBuffer and then roolback all modification. Then process editing buffer to

[Qgis-developer] wrapping changeAttributeValue between begin and end EditCommand

2015-03-15 Thread francescobocca...@libero.it
Hi all, i have a problem with beginEditCommand and endEditCommand wrapping. In my plugin i capture the layer.featureAdded signal : self.layer.featureAdded.connect(self.myfunction) The scope of my function is to change attribute of the feature added according with some rules. I wrap

Re: [Qgis-developer] wrapping changeAttributeValue between begin and end EditCommand

2015-03-15 Thread Martin Dobias
Hi Francesco Currently it is not safe to do calls that modify vector layer data in slots connected to signals notifying about data change (such as featureAdded). The issue is that at the point when those signals are emitted, their underlying undo commands were not yet pushed onto the stack, so