<div dir="ltr">Hi,<div>excuse me for the very very newby question.</div><div><br></div><div>I want to add a button in my custom form in order to toogle the editing status of a layer. I try to navigate the qgis api but I can't understand the way to stop editing and save/reject modify. I try to insert a code like this [0] (obviously the else part doesn't fit my request, it's just a pleaceholder to try my code).</div><div><br></div><div>[0]</div><div>def toggleEdit():</div><div>        aLayer = QgsMapLayerRegistry.instance().mapLayersByName('layer')[0]</div><div>        if not aLayer.isEditable():</div><div>                aLayer.startEditing()</div><div>        else:</div><div>                aLayer.rollBack(True) </div><div><br></div><div>any hint ?</div><div>thanks in advance</div><div><br></div><div>Luca</div><div><br></div><div><br></div></div>