[QGIS-Developer] outdated cookbook

Raymond Nijssen r.nijssen at terglobo.nl
Thu Jul 5 07:53:21 PDT 2018


Hi all,

I'm working on a qgis3 plugin, and want it to export my map as a png 
image. According to the cookbook it should go like this:

https://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/composer.html#simple-rendering

But QgsMapRenderer has been removed in v3, so I will need other code for 
this. I have been trying all kinds of stuff, using QgsMapRendererJob and 
QgsMapRendererSequentialJob but I cannot get it to work.
Even worse, qgis crashes all the time while I'm trial-and-erroring this.

Can anyone provide a working example for exporting maps to png files?

I'd be happy to work on updating the cookbook, for example during the 
Foss4g Europe code sprint in 2 weeks. But I will need some input from 
the people knowing the new object model.

Kind regards,
Raymond


More information about the QGIS-Developer mailing list