Hi list ..

If I define an event listener for event  geometryChanged event on object QgsVectorLayer in the Python console like this:

*=====================
*

*# event listener...
def feedback(fid, geom):
    # print id and geometry wkt in the console
    print ('id: {}, geometry: {}'.format(fid, geom.asWkt()))

# find layer
layer = iface.activeLayer()
*

*#  connect listener to event on layer
layer.geometryChanged.connect(feedback)*

*======================
*


It works nicely, printing the id and  the WKT of the object changed. However, the event fires *3* times, thus printing the same message 3 times.

Why does it do that ? (And no, I haven't connected it 3 times to the same event. If I connect it twice, I'll get *6* lines in the the console. And I did the experiment with a new user profile).

Windows 10, QGIS 3.26.3


--
Med venlig hilsen / Best regards

Bo Victor Thomsen
_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to