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

G. Allegri giohappy at gmail.com
Thu Mar 2 13:53:06 PST 2017


Thx Nyall, I was just trying QgsMapRendererSequentialJob and it works fine.
I was taking the code from an old plugin from mine...

giovanni

Il 2 mar 2017 22:46, "Nyall Dawson" <nyall.dawson at gmail.com> ha scritto:

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20170302/aba8fb02/attachment.html>


More information about the Qgis-developer mailing list