<div dir="ltr">Hey Andrew,<br><br>This is how I did it with Roam to get all the legend items for the layer:<div><br></div><div><div>items = layer.rendererV2().legendSymbologyItems(ICON_SIZE)</div></div><div><br></div><div>That will give you a list of:Text - Icon pairs</div><div><br>if you are using the rule base renderer you get can the symbol for the rule and paint that into a pixmap, however note that one feature can have many symbols so you will have to use the method that returns a list for all the symbols.</div><div><br></div><div>Depending on what you are doing  legendSymbologyItems might give you what you need without extra work.</div><div><br></div><div>- Nathan</div><div><br></div><div class="gmail_quote">On Fri, 8 May 2015 at 07:00 Andrew McClure <<a href="mailto:andrew@southweb.co.nz" target="_blank">andrew@southweb.co.nz</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Any takers for this one? I'd like to render the active symbol for a layer as a QPixmap in a dialog.<br>
<br>
I have got this far:<br>
<br>
       s =  layer().rendererV2()<br>
       key = s.rootRule().findRuleByKey(s.rootRule().ruleKey())<br>
<br>
This tells me the active rule key to be rendered but how to get the image data?<br>
<br>
Perhaps I am barking up the wrong tree here?<br>
<br>
Thanks<br>
_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">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>
</blockquote></div></div>