6

With QGIS 2.8 I need to create some composers based on a template, and save them using Python.

I've found how to load a template in a composition, but I can't find how to save this composition in the list of composers, nor how to create a QgsComposerView.

Do you know how to do so, or tell me where to look?

1
  • is there a solution for this? looking for the same May 15, 2016 at 7:55

1 Answer 1

1

You need to create a new composer like :

# it return a QgsComposerView
compo = iface.createNewComposer(title=u"My compo")
# template must be a QDomDocument
compo.composition().loadFromTemplate(template)
# you can then print your brand new composer
iface.activeComposers()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.