Re: [Qgis-developer] LoadFromTemplate method broken?
Hello Nyall, Thank you for your answer. I'm really ashamed : It was just a stupid path problem. I had already tried to import new composers created with QGIS 2.6, but trying again put me on the path to the solution. Thank you and really sorry for the noise. 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/ ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] LoadFromTemplate method broken?
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/ ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] LoadFromTemplate method broken?
On 4 December 2014 at 02:14, Vincent Damoy vincent.da...@espaces-naturels.fr wrote: 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) That code works fine for me... Have you tried with a different template file, or with a template created in 2.6? Nyall ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer