<div dir="ltr"><div><div><div><div>Hi, I noticed this statement in QgsVectorLayerProperties::saveStyleAs() method<br></div><div style="margin-left:40px"><pre><span>apply</span><span>();</span> <span>// make sure the style to save is uptodate</span></pre>


</div>just after the file dialog launch.<br></div><div>So, every time you want to export a style to a file, qgis applies it to the layer, losing precedent applied style.<br></div>But if the statement is removed, qgis simply crashs :) but I didn't managed why (in QgsRendererRangeV2::symbol() method).<br>


</div><div>I'm using part of saveStyleAs() (and related) code to create a qml style and save it into a postgis db.<br></div>Is it so important to apply the style before saving it? Is there any way to save avoiding to apply?<br>

<br></div>Thanks, <br>
<div><div><div><div><div><div><div><div><div><div><div><br clear="all"><div><div dir="ltr">Emilio Loi - <a href="mailto:loi@faunalia.it" target="_blank">loi@faunalia.it</a></div></div>

</div></div></div></div></div></div></div></div></div></div></div></div>