[Qgis-developer] Changing the Renderer Type in PyQGis Application

Matthias Kuhn matthias.kuhn at gmx.ch
Thu Nov 1 00:32:58 PDT 2012


Hi Justin,

What you want to do is probably create a new renderer of different type
and replace the current renderer with the new one. You have to create it
yourself.

In the API [1] click on "Inheritance diagram" (just on the top of the
page) to see, what subclasses are available.
The you set the new renderer on the vector layer, I think that should do
the trick.

Regards,
Matthias

[1]: http://www.qgis.org/api/classQgsFeatureRendererV2.html


On Thu, 2012-11-01 at 08:58 +0200, Justin Hubbard wrote:
> Hi
> 
> 
> I would like to know how to change the renderer type in a PyQGis
> application. 
> The vector layer (Spatialite) is a singleSymbol type currently. (Point
> geometries) and I need to change the symbols depending on the value of
> an attribute in the layer.
> I am new to Python and QGis so have no idea how to do this. (I notice
> that there is no setType method on the QgsFeatureRendererV2, which i
> would have assumed would do the trick)
> 
> 
> Any help appreciated
> _______________________________________________
> 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