Skip to main content
2 of 2
added 74 characters in body; edited tags; edited title
Taras
  • 34k
  • 4
  • 73
  • 148

Getting the signal when the color changes in PyQGIS

I would like to have the signal when the color of a vector layer is changed by the user. In the doc, there is a signal that seems to fit (http://qgis.org/api/classQgsVectorLayer.html#a403f235d3743aa59bb3aad69a72a5705) but nothing happens when it is called.

I have a method called rendererChanged:

QObject.connect(self.iface.activeLayer(), SIGNAL("rendererChanged()"), self.DoSomething)

When executed, my function DoSomething is not executed.

I have also tried :

self.iface.activeLayer().rendererChanged.connect(self.toto)

But I get this error:

AttributeError: 'QgsVectorLayer' object has no attribute 'rendererChanged'