<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Hello All,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>First off I’m quite the newbie when it comes to developing PyQGIS plugins so hopefully this post makes sense…<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’m creating a vector layer using the memory provider. Layer consists of polygons and everything is working great. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’m now attempting to tailor the appearance of the symbols. Following the advice in this post (<a href="http://lists.osgeo.org/pipermail/qgis-developer/2011-April/013772.html">http://lists.osgeo.org/pipermail/qgis-developer/2011-April/013772.html</a>) I successfully created just an outline (i.e. no fill):<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-family:"Courier New"'> props = { 'color_border' : '255,0,0,255', 'style' : 'no', 'style_border' : 'solid' }<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> s = QgsFillSymbolV2.createSimple(props)<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> vl.setRendererV2( QgsSingleSymbolRendererV2( s ) )<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>This is close to what I’d like but I notice that when selecting features the selected features become filled which is not what I’d like. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Manually adjusting the properties via the “Symbol properties” dialog I discovered that by selecting “Outline: Simple line” from the “Symbol layer type” pulldown provides the functionality I desire. When selecting features the color of the outline changes while remaining un-filled. Looking at the resulting entry in symbology-ng-style.xml shows the following:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-family:"Courier New"'> <symbol outputUnit="MM" alpha="1" type="fill" name="Dash Foo"><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> <layer pass="0" class="SimpleLine" locked="0"><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> <prop k="capstyle" v="square"/><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> <prop k="color" v="0,85,0,255"/><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> <prop k="customdash" v="5;2"/><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> <prop k="joinstyle" v="bevel"/><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> <prop k="offset" v="0"/><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> <prop k="penstyle" v="dash"/><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> <prop k="use_custom_dash" v="0"/><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> <prop k="width" v="0.37"/><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> </layer><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> </symbol><o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I haven’t had any luck in figuring out how to get the proper combination of type=”fill” while using “SimpleLine”. I also noticed that if I follow the example in the PyQGIS Cookbook to display the complete list of types for a QgsSymbolV2.Fill none of the “Outline: <foo>” types from the dialog pulldown are listed:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-family:"Courier New"'> myRegistry = QgsSymbolLayerV2Registry.instance()<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> for item in myRegistry.symbolLayersForType(QgsSymbolV2.Fill):<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> … print item<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> CentroidFill<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> LinePatternFill<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> PointPatternFill<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> SVGFill<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> SimpleFill<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Any advice on how to replicate the “Outline: Simple line” symbology will be greatly appreciated!<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>-- Dan<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>