[Qgis-developer] QgsMapRenderer rotation doesn't print rotated map

Nyall Dawson nyall.dawson at gmail.com
Thu Mar 2 13:46:55 PST 2017


On 3 March 2017 at 07:11, G. Allegri <giohappy at gmail.com> wrote:
> Looking into QgsMapRenderer it looks like rotation is never used during
> rendering. It's not passed in any way to the layers during the rendering
> phase.
>
> I guess it's used (in other ways) only for canvas rendering...
>
> How should a renderer rotate contents during image rendering? Should I apply
> the rotation directly on the QPainter (painter.rotate())?
>

QgsMapRenderer is very old and was removed in QGIS 3.0. Its
replacement is QgsMapRendererJob with use of QgsMapSettings for the
map parameters.

If you use QgsMapSettings with setRotation this should work without issue.

Nyall


More information about the Qgis-developer mailing list