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

Justin Hubbard justin at pyrotechsoftware.com
Thu Nov 1 03:19:00 PDT 2012


Hi

I have managed to change the layer renderer.
Thanks for your assistance.

In line with this, Is there any way to open a QGIS dialog (To edit layer
properties for example) from a PyQGis application?
Has anyone been able to do this?

Thanks
Justin

On Thu, Nov 1, 2012 at 9:32 AM, Matthias Kuhn <matthias.kuhn at gmx.ch> wrote:

> 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
>
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20121101/000ef564/attachment.html>


More information about the Qgis-developer mailing list