Hi Larry. <div>I've done it programmatically, passing the renderer clone (V2 or not) to the other layer, updating the legendlayer and refreshing the canvas. I suppose those actions will trigger a similar flow of things.</div>
<div>In my case it wouldn't be enough because I should avoid changing the activeLayer. In my method I pass the layer reference...</div><div><br></div><div>thanks anyway, because it's a useful GUI tool ;)</div><div>
giovanni</div><div><br><div class="gmail_quote">2012/11/27 Larry Shaffer <span dir="ltr"><<a href="mailto:larrys@dakotacarto.com" target="_blank">larrys@dakotacarto.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Giovanni,<br>
<div><div class="h5"><br>
On Tue, Nov 27, 2012 at 3:26 AM, G. Allegri <<a href="mailto:giohappy@gmail.com">giohappy@gmail.com</a>> wrote:<br>
> I need to replicate the theming of a vector layer to another one.<br>
> I thought that cloning the oringinal renderer (being it V2 or not) and<br>
> applying it to other layer would be enough, but id doesn't have effects. The<br>
> other layer is applied the default (random) styling.<br>
> Probably I've misunderstood the renderer mechanism. How should one procede<br>
> to obtain it?<br>
<br>
</div></div>I just exposed QgisApp's mActionCopyStyle and mActionPasteStyle to<br>
QgisInterface [0]. Is this what you are looking for (in Python)?<br>
<br>
Usage:<br>
<br>
  iface.setActiveLayer( someQgsMapLayer )<br>
  iface.actionCopyLayerStyle().trigger()<br>
<br>
  iface.setActiveLayer( someotherQgsMapLayer )<br>
  iface.actionPasteLayerStyle().trigger()<br>
<br>
Regards,<br>
<br>
Larry<br>
<br>
[0] <a href="https://github.com/qgis/Quantum-GIS/commit/b9b943d5e1580bdc17435598dd5be41eb0c2a853" target="_blank">https://github.com/qgis/Quantum-GIS/commit/b9b943d5e1580bdc17435598dd5be41eb0c2a853</a><br>
<br>
> giovanni<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>
</blockquote></div><br></div>