[QGIS-Developer] QgsVectorLayer featureAdded not firing
Catania, Luke A ERDC-RDE-GRL-VA CIV
Luke.A.Catania at erdc.dren.mil
Fri Oct 25 07:10:29 PDT 2024
The link is invalid. I tried the full link and just connecting to https://i.ibb.co/6mpXy31/. Seems odd to be connecting to a gif.
From: Jacky Volpes <jacky.volpes at oslandia.com>
Sent: Friday, October 25, 2024 5:29 AM
To: Catania, Luke A ERDC-RDE-GRL-VA CIV <Luke.A.Catania at erdc.dren.mil>
Cc: qgis-developer at lists.osgeo.org
Subject: Re: [QGIS-Developer] QgsVectorLayer featureAdded not firing
Hi Luke,
I tried your code with QGIS 3.34.11 and the featureAdded Signal is indeed fired...
I made a short video Blockedhttps://i.ibb.co/6mpXy31/feature-added.gifBlocked
Regards,
--
Jacky Volpes
Ingénieur développeur SIG - Oslandia
Le 24/10/2024 à 20:12, Catania, Luke A ERDC-RDE-GRL-VA CIV via QGIS-Developer a écrit :
I do not understand why after creating a layer and adding it to the layer panel then start editing why after drawing on the map canvas, the featureAdded signal is not firing?
I have tried many and beforeCommitChanges and afterCommitChanges work but not featureAdded which is what I use in many other parts of my code.
vlayer.startEditing()
vlayer.featureAdded.connect(lambda: self.signal_event("featureAdded"))
actions = self.digitizing_toolbar.actions()
for action in actions:
if (action.text() == ''):
if (action.defaultWidget().menu() != None
and action.defaultWidget().defaultAction().text() != 'Digitize with Segment'):
for sub_action in action.defaultWidget().menu().actions():
if (sub_action.text() == 'Digitize with Segment'):
action.defaultWidget().setDefaultAction(sub_action)
action.defaultWidget().menu().setActiveAction(sub_action)
action.defaultWidget().defaultAction().setChecked(True)
action.defaultWidget().defaultAction().activate(0)
iface.actionAddFeature().trigger()
Luke Catania
US Army ERDC-GRL
JCMS Site Planning Developer
_______________________________________________
QGIS-Developer mailing list
QGIS-Developer at lists.osgeo.org<mailto:QGIS-Developer at lists.osgeo.org>
List info: Blockedhttps://lists.osgeo.org/mailman/listinfo/qgis-developerBlocked
Unsubscribe: Blockedhttps://lists.osgeo.org/mailman/listinfo/qgis-developerBlocked
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20241025/83516dda/attachment.htm>
More information about the QGIS-Developer
mailing list