[Qgis-developer] SIGNAL to know when a feature is added to vector layer using PyQGIS

Matthias Kuhn matthias at opengis.ch
Thu Jun 9 23:43:08 PDT 2016


Hi Germán,

I don't think there's a signal to do that.

Is there a reason you have to write the the dataprovider directly rather
then using the layer's methods?
If you are in control of the code writing to the dataprovider and the
code that should react to this, you could also produce the signalling on
your side.

Matthias

On 06/09/2016 11:24 PM, Germán Carrillo wrote:
> Hi, 
> 
> I'd like to ask you whether you know any way of being notified when a
> feature is being added to a vector layer without opening and closing an
> edit session, e.g., by using:
> 
> myLayer.dataProvider().addFeatures( [feature] )
> 
> Which directly writes the new feature to the provider. 
> 
> When working with an edit session I can use featureAdded SIGNAL, which
> gives me the feature id, but still haven't found a way of using such
> SIGNAL with no edit session involved. 
> 
> Regards,
> 
> Germán
> 
> -- 
> -----------
>    |\__ 
> (:>__)(
>    |/   
> Soluciones Geoinformáticas Libres                            
> http://geotux.tuxfamily.org/
> http://twitter.com/GeoTux2
> http://about.me/germancarrillo
> 
> <http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
> 
> 
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> 


More information about the Qgis-developer mailing list