<div dir="ltr">Thanks a lot for those fast and accurate suggestions.<div><br><div>We try to do as you propose and post the result here! <br><br>Many thanks,</div><div>Rémi-C</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-02-12 18:07 GMT+01:00 Martin Dobias <span dir="ltr"><<a href="mailto:wonder.sk@gmail.com" target="_blank">wonder.sk@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi again Remi<br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Thu, Feb 12, 2015 at 11:46 PM, Rémi Cura <span dir="ltr"><<a href="mailto:remi.cura@gmail.com" target="_blank">remi.cura@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hello again dear list,</div><div><br></div><div>Our goal is to save (commitchanges) any modification of a vector layer when it happens.</div><div><br><div><br></div><div><div>We encountered another problem when trying to exploit the </div>layer.geometryChanged event.<br></div><div><br></div><div>Upon activation of this event, we tried to use the layer.commitChanges() to save changes in geometry of the layer (postgis layer, maybe not related), </div><div><br></div><div>But it hard-crashes QGIS.<br>A quick gdb look seems to indicate a rollback issue??</div></div></div></blockquote><div> </div></span><div>It is not a good idea to try to commit changes in a slot connected to a signal about layer modification - crashes due to corrupted undo stack can be expected (the undo stack is not in final state yet at the time of the signal being emitted). Also often the changes are done in batches (e.g. field calculator) and if you committed changes after each single change, this may lead to poor performance due to separate transactions.</div><div><br></div><div>I think for your use case you could watch changes to the undo stack and commit whenever you detect a new undo command is added (e.g. canUndoChanged() or indexChanged() signal) you could commit the changes.</div><div><br></div><div>Regards</div><span class="HOEnZb"><font color="#888888"><div>Martin</div><div><br></div></font></span></div></div></div>
</blockquote></div><br></div>