Hi,
excuse me for the very very newby question.

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).

[0]
def toggleEdit():
        aLayer = QgsMapLayerRegistry.instance().mapLayersByName('layer')[0]
        if not aLayer.isEditable():
                aLayer.startEditing()
        else:
                aLayer.rollBack(True)

any hint ?
thanks in advance

Luca
_______________________________________________
Qgis-developer mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to