<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi Tom,<br>
    <br>
    Quote from the API docs:<br>
    <br>
    > Must be called between<span class="Apple-converted-space"> </span><a
      class="el"
href="http://qgis.org/api/classQgsFeatureRendererV2.html#ab4513895a219eb24e803fe9de34c230b"
      title="Needs to be called when a new render cycle is started. "
      style="color: rgb(70, 101, 162); font-weight: bold;
      text-decoration: none;">startRender()</a><span
      class="Apple-converted-space"> </span>and<span
      class="Apple-converted-space"> </span><a class="el"
href="http://qgis.org/api/classQgsFeatureRendererV2.html#a704fb69e3906576444b87e28084d2235"
      title="Needs to be called when a render cycle has finished to
      clean up. " style="color: rgb(70, 101, 162); font-weight: bold;
      text-decoration: none;">stopRender()</a><span
      class="Apple-converted-space"> </span>calls.
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <br>
    <br>
<a class="moz-txt-link-freetext" href="http://qgis.org/api/classQgsFeatureRendererV2.html#afc251a5e609aac561ce622d328b87289">http://qgis.org/api/classQgsFeatureRendererV2.html#afc251a5e609aac561ce622d328b87289</a><br>
    <br>
    Cheers<br>
    Matthias<br>
    <br>
    <div class="moz-cite-prefix">On 03/07/2016 04:35 PM, Tom Chadwin
      wrote:<br>
    </div>
    <blockquote cite="mid:1457364923006-5254907.post@n6.nabble.com"
      type="cite">
      <pre wrap="">The following code works for a layer which has the 2.5d renderer selected:

feats = layer.getFeatures()
for feat in feats:
    symbol = layer.rendererV2().symbolForFeature(feat)

This still works if I change the layer to a single symbol renderer. However,
if I change it to a categorized symbol renderer, and classify on one field
(random colours, nothing else in the style changed from the 2.5d), the last
line above causes a mindump.

Can anyone help?



--
View this message in context: <a class="moz-txt-link-freetext" href="http://osgeo-org.1560.x6.nabble.com/symbolForFeature-feat-causes-minidump-in-converted-2-5d-layers-tp5254907.html">http://osgeo-org.1560.x6.nabble.com/symbolForFeature-feat-causes-minidump-in-converted-2-5d-layers-tp5254907.html</a>
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
_______________________________________________
Qgis-developer mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/qgis-developer">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/qgis-developer">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a></pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Matthias Kuhn
OPENGIS.ch - <a class="moz-txt-link-freetext" href="https://www.opengis.ch">https://www.opengis.ch</a>
Spatial • (Q)GIS • PostGIS • Open Source</pre>
  </body>
</html>