I saved a template qpt for the map composer and now I want to read all the settings. I am able to insert the items with composition.addItemsfromXML... But this doesn't load the settings for the QgsPaperItem. This is the code:
composition = newCompView.composition()
file = QFile(self.plugin.rootDirectory + "ui/PrintTemplates/" + self.printTemplate)
doc = QDomDocument()
doc.setContent(file, False)
docElem = doc.documentElement()
composition.clear()
paper = QgsPaperItem(composition)
paper.readXML(docElem, doc)
composition.addItem(paper)
composition.moveItemToBottom(paper)
composition.addItemsFromXML( docElem, doc)
With readXML the paperItem remains empty. I just managed to set it manually in the code. But I want this to be loaded from the template...