[Qgis-developer] PyQT - How to get layer sending attributeValueChanged signal?

HAUBOURG regis.haubourg at eau-adour-garonne.fr
Mon Feb 24 08:30:35 PST 2014



 A followup:
I had my class inherit from QObject (first time doing that for me) and I catch the sender correctly. 
Strangely, I catch the signal twice, so maybe inherinting from QObject triggers another signalk somewhere.. 
Cheers


> -----Message d'origine-----
> De : Matthias Kuhn [mailto:matthias.kuhn at gmx.ch]
> Envoyé : lundi 24 février 2014 15:21
> À : HAUBOURG
> Cc : qgis-developer at lists.osgeo.org
> Objet : Re: [Qgis-developer] PyQT - How to get layer sending
> attributeValueChanged signal?
> 
> Hi Régis
> 
> Calling sender() in your SLOT should return the QgsVectorLayer object There
> is also QSignalMapper [1] which has a cleaner concept, but it looks as if this
> will on the one hand help you to identify the source layer, but you will loose
> any other parameters, what's probably not your intent.
> 
> Best
> Matthias
> 
> [1] http://qt-project.org/doc/qt-4.8/qsignalmapper.html
> 
> On Mon 24 Feb 2014 02:57:37 PM CET, Régis Haubourg wrote:
> > Hi,
> > I would like to catch the layer or layer id that is sending
> > attributeValueChanged signal.
> > This signal carries only  QgsFeatureId fid,	int  	idx, const QVariant & )
> 
> >
> > Any idea how to do this in a clean way?
> >
> > Cheers,
> > Régis
> >
> >
> >
> > --
> > View this message in context:
> > http://osgeo-org.1560.x6.nabble.com/PyQT-How-to-get-layer-sending-
> attr
> > ibuteValueChanged-signal-tp5105532.html
> > Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
> > _______________________________________________
> > Qgis-developer mailing list
> > Qgis-developer at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/qgis-developer
> 
> 



More information about the Qgis-developer mailing list