<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hello all,<br>
</p>
<p>Since QGIS 2.6, the LoadFromTemplate method seems not work any
more (or works differently?)</p>
<p>This is my code to add items in my composer from a template :</p>
<pre style="" class="lang-py prettyprint prettyprinted"><code><span class="pln">self</span><span class="pun">.</span><span class="pln">composition </span><span class="pun">=</span><span class="pln"> self</span><span class="pun">.</span><span class="pln">composerView</span><span class="pun">.</span><span class="pln">composition</span><span class="pun">()</span><span class="pln">
file1</span><span class="pun">=</span><span class="typ">QtCore</span><span class="pun">.</span><span class="typ">QFile</span><span class="pun">(</span><span class="str">'ComposerTemplate.qpt'</span><span class="pun">)</span><span class="pln">
doc</span><span class="pun">=</span><span class="typ">QtXml</span><span class="pun">.</span><span class="typ">QDomDocument</span><span class="pun">()</span><span class="pln">
doc</span><span class="pun">.</span><span class="pln">setContent</span><span class="pun">(</span><span class="pln">file1</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">False</span><span class="pun">)</span><span class="pln">
self</span><span class="pun">.</span><span class="pln">composition</span><span class="pun">.</span><span class="pln">loadFromTemplate</span><span class="pun">(</span><span class="pln">doc</span><span class="pun">,</span><span class="pln"> substitutionMap</span><span class="pun">=</span><span class="kwd">None</span><span class="pun">,</span><span class="pln"> addUndoCommands </span><span class="pun">=</span><span class="kwd">False</span><span class="pun">)</span></code></pre>
<p>Up to 2.4 version, this code worked great. But since the last
QGIS update, nothing is imported from the template. I do not get
either error messages.</p>
<p>I've readen in QGIS changelogs, that the "Load from template"
button is replaced by a "softer" "Add items from template" one.
But it's in the GUI... In the API doc, the LoadFromTemplate method
is still present. And should still work?<br>
Has anybody else encountered this problem?<br>
</p>
<p>Thanks<br>
Vincent</p>
<div class="moz-signature">--<br>
<div class="moz-signature">
<div class="moz-signature">
<div class="moz-signature">
<div class="moz-signature">
<div class="moz-signature"><br>
<div class="moz-signature">
<table height="105" width="818" border="0"
cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td colspan="2" rowspan="1" valign="top"
width="200">Vincent Damoy - Responsable SIG<br>
Conservatoire d'espaces naturels du Nord et du
Pas-de-Calais<br>
152 bd de Paris - 62190 Lillers<br>
Tél : 03.21.54.75.00 - Fax : 03.21.54.56.07<br>
<small><font color="#009900"><i><b>Pour
adhérer au Conservatoire :</b> <a
class="moz-txt-link-abbreviated"
href="http://www.cen-npdc.org/nous-rejoindre/adherent.html">www.cen-npdc.org/nous-rejoindre/adherent.html</a></i></font></small></td>
</tr>
</tbody>
</table>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>