[Qgis-developer] LoadFromTemplate method broken?

Vincent Damoy vincent.damoy at espaces-naturels.fr
Wed Dec 3 07:14:52 PST 2014


Hello all,

Since QGIS 2.6, the LoadFromTemplate method seems not work any more (or 
works differently?)

This is my code to add items in my composer from a template :

|self.composition=  self.composerView.composition()
file1=QtCore.QFile('ComposerTemplate.qpt')
doc=QtXml.QDomDocument()
doc.setContent(file1,  False)
self.composition.loadFromTemplate(doc,  substitutionMap=None,  addUndoCommands=False)|

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.

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?
Has anybody else encountered this problem?

Thanks
Vincent

--

Vincent Damoy - Responsable SIG
Conservatoire d'espaces naturels du Nord et du Pas-de-Calais
152 bd de Paris - 62190 Lillers
Tél : 03.21.54.75.00 - Fax : 03.21.54.56.07
/*Pour adhérer au Conservatoire :* 
www.cen-npdc.org/nous-rejoindre/adherent.html/


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20141203/85ab341d/attachment.html>


More information about the Qgis-developer mailing list