With this code on a vectorLayer v_layer:

QObject.connect(v_layer, SIGNAL("layerModified()"), self.interceptModify)

I can intercept when a geometry is changed, but how do i find which feature has been changed?

I need to find the modified feature id, but layerModified signal has not parameter

i tryed with

QObject.connect(v_layer, SIGNAL("geometryChanged(QgsFeatureId, QgsGeometry)"), self.interceptEditingModify)

no error, but the signal is not emitted by qgis

  • 2
    geometryChanged: The new Style def test(fid, geometry): ... iface.activeLayer().geometryChanged.connect(test) seems to work. Don't know how to write it old style.
    – Redoute
    Commented Sep 20, 2017 at 19:18
  • 1
    Just don't use old style connects - there's absolutely no reason to choose them over the new style.
    – ndawson
    Commented Sep 20, 2017 at 23:15
  • 1
    Please don't add "SOLVED:" to the topic title. Instead, use the Answer section below for a self-answer, for the benefit of future visitors: meta.stackexchange.com/questions/116101/…
    – AndreJ
    Commented Sep 21, 2017 at 11:26


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.