QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
Public Member Functions | List of all members
QgsScopedRenderContextScaleToPixels Class Reference

Scoped object for temporary scaling of a QgsRenderContext for pixel based rendering. More...

#include <qgsrendercontext.h>

Public Member Functions

 QgsScopedRenderContextScaleToPixels (QgsRenderContext &context)
 Constructor for QgsScopedRenderContextScaleToPixels. More...
 
 ~QgsScopedRenderContextScaleToPixels ()
 Returns the destination painter back to millimeter based units. More...
 

Detailed Description

Scoped object for temporary scaling of a QgsRenderContext for pixel based rendering.

Temporarily scales the destination QPainter for a QgsRenderContext to use pixel based units for the lifetime of the object, before returning it to millimeter based units on destruction.

Note
Not available in Python bindings
Since
QGIS 3.14

Definition at line 1292 of file qgsrendercontext.h.

Constructor & Destructor Documentation

◆ QgsScopedRenderContextScaleToPixels()

QgsScopedRenderContextScaleToPixels::QgsScopedRenderContextScaleToPixels ( QgsRenderContext context)
inline

Constructor for QgsScopedRenderContextScaleToPixels.

Rescales the destination painter (see QgsRenderContext::painter() ) to use pixel based units.

Warning
It is the caller's responsibility to ensure that context is initially scaled to use millimeter based units!

Definition at line 1303 of file qgsrendercontext.h.

◆ ~QgsScopedRenderContextScaleToPixels()

QgsScopedRenderContextScaleToPixels::~QgsScopedRenderContextScaleToPixels ( )
inline

Returns the destination painter back to millimeter based units.

Definition at line 1313 of file qgsrendercontext.h.


The documentation for this class was generated from the following file: