[Qgis-developer] currentLayerChanged signal

Michele Mammini mamminim at yahoo.it
Mon Feb 22 04:22:09 EST 2010

My problem is to catch the signal when the user change the selection 
of a layer in the legend.
The signal you suggest are only for adding/removing layer.

At moment i'm using the Kore version (1.0.2) of QGis.


At 13:25 19/02/2010, motta.luiz at gmail.com wrote:
>a) See the signals in Mapcanvas API
>layersChanged ()
>b) May be you need the theses SIGNALS:
>layerWasAdded(QgsMapLayer *)
>See in http://doc.qgis.org/head/classQgsMapLayerRegistry.html
>Example in tools (plugin downloads):
>a) C:\Documents and 
>self.connect(self.canvas, SIGNAL("layersChanged()"), self.fillInputLayerCombo)
>b) C:\Documents and 
>QtCore.SIGNAL("layerWillBeRemoved(QString)"), self.__removeLayer)
>QtCore.SIGNAL("layerWasAdded(QgsMapLayer *)"), self.__addLayer)
>Michele Mammini escreveu:
>>Dear all,
>>in my python plugin i have to catch the currentLayerChanged to 
>>enabled/disable a button in the toolbar, but i don't know where and 
>>how write the signal connect to it.
>>I suppose that the signal must be write in the main plugin file...
>>May someone can suggest me the correct procedure?
>>Thanks, Michele.
>>Qgis-developer mailing list
>>Qgis-developer at lists.osgeo.org

More information about the Qgis-developer mailing list