I Googled the deprecation message and the only result was a GIS.se question I asked that referenced the error. Despite this constructor having been deprecated in
QGIS 2.4, there's a recent question still using the deprecated construction, and one of the highest voted answers on the topic relies on it as well:
renderer = QgsMapRenderer() myComposition = QgsComposition(myMapRenderer) with open(template_composer, 'r') as template: new_composer_content = template.read() new_composer_document = QDomDocument() new_composer_document.setContent(new_composer_content) composition.loadFromTemplate(new_composer_document)
How should I update this code for PyQGIS versions greater than 2.4?