[Qgis-developer] LoadFromTemplate method broken?

Nyall Dawson nyall.dawson at gmail.com
Wed Dec 3 15:02:19 PST 2014


On 4 December 2014 at 02:14, Vincent Damoy
<vincent.damoy at 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


More information about the Qgis-developer mailing list