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

How to get Getting the signal when the color changes in pyQGIS?PyQGIS

I would like to have the signal when the color of a vector layer is changed by the user. In 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)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)

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

But I get this error  : AttributeError: 'QgsVectorLayer' object has no attribute 'rendererChanged'

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

How to get 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'

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'
Bumped by Community user
Source Link

How to get 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'