[Qgis-developer] How to set Vector layer transparency with pyQgis ?

2013-12-03 Thread Geo DrinX
Hello all,

... as in object, I need to set the transparency of all the vector layers
in my plugin ( rasparenza ).

What is the syntax to set the transparency of a vector layer (in pyQis 1.8
and 2.0 versions ) ?

I am searching in documentation and in  gis.stackexchange,  but I only
found... myself.


Thank you in advance for any info

Roberto
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] How to set Vector layer transparency with pyQgis ?

2013-12-03 Thread Ujaval
How about this?

layer = iface.mapCanvas().currentLayer()
layer.setLayerTransparency(50)  # int between 0 and 100
iface.mapCanvas().refresh()

I don't have a 1.8 version handy, but I think layer.setTransparency() would
work with the old API.

-Ujaval

On Tue, Dec 3, 2013 at 4:55 PM, Geo DrinX geodr...@gmail.com wrote:

 Hello all,

 ... as in object, I need to set the transparency of all the vector layers
 in my plugin ( rasparenza ).

 What is the syntax to set the transparency of a vector layer (in pyQis 1.8
 and 2.0 versions ) ?

 I am searching in documentation and in  gis.stackexchange,  but I only
 found... myself.


 Thank you in advance for any info

 Roberto

 ___
 Qgis-developer mailing list
 Qgis-developer@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/qgis-developer

___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer