Can iface be called from a standalone PyQGis application? <br><div><br><div class="gmail_quote">On Thu, Nov 1, 2012 at 1:12 PM, Matthias Kuhn <span dir="ltr"><<a href="mailto:matthias.kuhn@gmx.ch" target="_blank">matthias.kuhn@gmx.ch</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thu, 2012-11-01 at 12:19 +0200, Justin Hubbard wrote:<br>
> In line with this, Is there any way to open a QGIS dialog (To edit<br>
> layer properties for example) from a PyQGis application?<br>
> Has anyone been able to do this?<br>
</div>Try:<br>
iface.showLayerProperties( mapLayer )<br>
<br>
Cheers,<br>
Matthias<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
><br>
> Thanks<br>
> Justin<br>
><br>
> On Thu, Nov 1, 2012 at 9:32 AM, Matthias Kuhn <<a href="mailto:matthias.kuhn@gmx.ch">matthias.kuhn@gmx.ch</a>><br>
> wrote:<br>
>         Hi Justin,<br>
><br>
>         What you want to do is probably create a new renderer of<br>
>         different type<br>
>         and replace the current renderer with the new one. You have to<br>
>         create it<br>
>         yourself.<br>
><br>
>         In the API [1] click on "Inheritance diagram" (just on the top<br>
>         of the<br>
>         page) to see, what subclasses are available.<br>
>         The you set the new renderer on the vector layer, I think that<br>
>         should do<br>
>         the trick.<br>
><br>
>         Regards,<br>
>         Matthias<br>
><br>
>         [1]: <a href="http://www.qgis.org/api/classQgsFeatureRendererV2.html" target="_blank">http://www.qgis.org/api/classQgsFeatureRendererV2.html</a><br>
><br>
><br>
>         On Thu, 2012-11-01 at 08:58 +0200, Justin Hubbard wrote:<br>
>         > Hi<br>
>         ><br>
>         ><br>
>         > I would like to know how to change the renderer type in a<br>
>         PyQGis<br>
>         > application.<br>
>         > The vector layer (Spatialite) is a singleSymbol type<br>
>         currently. (Point<br>
>         > geometries) and I need to change the symbols depending on<br>
>         the value of<br>
>         > an attribute in the layer.<br>
>         > I am new to Python and QGis so have no idea how to do this.<br>
>         (I notice<br>
>         > that there is no setType method on the QgsFeatureRendererV2,<br>
>         which i<br>
>         > would have assumed would do the trick)<br>
>         ><br>
>         ><br>
>         > Any help appreciated<br>
><br>
>         > _______________________________________________<br>
>         > Qgis-developer mailing list<br>
>         > <a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
>         > <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
><br>
><br>
>         _______________________________________________<br>
>         Qgis-developer mailing list<br>
>         <a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
>         <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
><br>
><br>
<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><p><span style="font-family:verdana,geneva;font-size:x-small">Warm regards</span><br><strong><span style="font-family:verdana,geneva;font-size:x-small">Justin Hubbard</span></strong><br>
<br><strong><span style="font-family:verdana,geneva;font-size:x-small">--</span></strong><br></p><table border="0" cellspacing="1" cellpadding="0" style="background-color:rgb(0,51,102);width:250px;height:217px"><tbody><tr>
<td style="margin:0px;padding:1.5pt;font-family:arial,sans-serif;background-color:white"><table border="0" cellpadding="0" style="background-color:white;width:241px;height:207px"><tbody><tr><td colspan="2" style="margin:0px;padding:0.75pt">
<table border="0" cellspacing="0" cellpadding="0" style="width:347px;height:212px"><tbody><tr style="min-height:10.5pt"><td width="14" valign="top" style="margin:0px;padding:0in;min-height:10.5pt;width:10.5pt"> </td><td style="margin:0px;padding:0in;min-height:10.5pt">
 <p dir="ltr" style="margin:0px;text-align:justify"> </p></td><td style="margin:0px;padding:0in;min-height:10.5pt"> <p dir="ltr" style="margin:0px;text-align:justify"><span style="font-family:verdana,geneva"><strong><span style="font-size:10pt;color:red">Justin Hubbard</span></strong></span></p>
<p dir="ltr" style="margin:0px;text-align:justify"><span style="font-size:7.5pt;color:rgb(0,51,102)">Software Engineer and Support<br><br></span></p></td></tr><tr style="min-height:10.5pt"><td width="14" valign="top" style="margin:0px;padding:0in;min-height:10.5pt;width:10.5pt">
<p style="margin:0px"> </p></td><td style="margin:0px;padding:0in;min-height:10.5pt"><p style="margin:0px;line-height:10.5pt"><span style="font-size:7.5pt;color:rgb(0,51,102)">  Mobile:</span></p></td><td style="margin:0px;padding:0in;min-height:10.5pt">
<p style="margin:0px;line-height:10.5pt"><span style="font-size:7.5pt;color:rgb(0,51,102)">  +27 (0)79 827 1657</span></p></td></tr><tr style="min-height:10.5pt"><td width="14" valign="top" style="margin:0px;padding:0in;min-height:10.5pt;width:10.5pt">
<p style="margin:0px"> </p></td><td style="margin:0px;padding:0in;min-height:10.5pt"><p style="margin:0px;line-height:10.5pt"><span style="font-size:7.5pt;color:rgb(0,51,102)">  Fax:</span></p></td><td style="margin:0px;padding:0in;min-height:10.5pt">
<p style="margin:0px;line-height:10.5pt"><span style="font-size:7.5pt;color:rgb(0,51,102)">  +27 (0)86 540 6016</span></p></td></tr><tr style="min-height:10.5pt"><td width="14" valign="top" style="margin:0px;padding:0in;min-height:10.5pt;width:10.5pt">
<p style="margin:0px"> </p></td><td style="margin:0px;padding:0in;min-height:10.5pt"><p style="margin:0px;line-height:10.5pt"><span style="font-size:7.5pt;color:rgb(0,51,102)">  Email:</span></p></td><td style="margin:0px;padding:0in;min-height:10.5pt">
<p style="margin:0px;line-height:10.5pt"><span style="font-size:7.5pt;color:navy">  <span style="color:blue"><span style="color:rgb(0,0,204)"><a title="Email Me" href="mailto:robert@plannermunicipalsoftware.co.za" target="_blank">justin@pyrotechsoftware.com</a></span></span></span></p>
</td></tr><tr style="min-height:10.5pt"><td width="14" valign="top" style="margin:0px;padding:0in;min-height:10.5pt;width:10.5pt"><p style="margin:0px"> </p></td><td style="margin:0px;padding:0in;min-height:10.5pt"><p style="margin:0px;line-height:10.5pt">
<span style="font-size:7.5pt;color:rgb(0,51,102)">  Web Site:</span></p></td><td style="margin:0px;padding:0in;min-height:10.5pt"><p style="margin:0px;line-height:10.5pt"><span style="font-size:7.5pt;color:navy">  <span style="color:blue"><span style="color:rgb(0,0,204)"><a title="About Me" href="http://www.plannermunicipalsoftware.co.za/" target="_blank">www.pyrotechsoftware.co</a>m</span></span></span></p>
</td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table><br>
</div>