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

Justin Hubbard justin at pyrotechsoftware.com
Thu Nov 1 04:24:25 PDT 2012


Can iface be called from a standalone PyQGis application?

On Thu, Nov 1, 2012 at 1:12 PM, Matthias Kuhn <matthias.kuhn at gmx.ch> wrote:

> On Thu, 2012-11-01 at 12:19 +0200, Justin Hubbard wrote:
> > 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?
> Try:
> iface.showLayerProperties( mapLayer )
>
> Cheers,
> Matthias
>
> >
> >
> > 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
> >
> >
>
>
>


-- 

Warm regards
*Justin Hubbard*

*--*





*Justin Hubbard*

Software Engineer and Support



  Mobile:

  +27 (0)79 827 1657



  Fax:

  +27 (0)86 540 6016



  Email:

  justin at pyrotechsoftware.com <robert at plannermunicipalsoftware.co.za>



  Web Site:

  www.pyrotechsoftware.co <http://www.plannermunicipalsoftware.co.za/>m
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20121101/f830ca52/attachment-0001.html>


More information about the Qgis-developer mailing list