QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QgsLayoutItemRenderContext Class Reference

Contains settings and helpers relating to a render of a QgsLayoutItem. More...

#include <qgslayoutitem.h>

Public Member Functions

 QgsLayoutItemRenderContext (const QgsLayoutItemRenderContext &other)=delete
 
 QgsLayoutItemRenderContext (QgsRenderContext &context, double viewScaleFactor=1.0)
 Constructor for QgsLayoutItemRenderContext.
 
QgsLayoutItemRenderContextoperator= (const QgsLayoutItemRenderContext &other)=delete
 
QgsRenderContextrenderContext ()
 Returns a reference to the context's render context.
 
const QgsRenderContextrenderContext () const
 Returns a reference to the context's render context.
 
double viewScaleFactor () const
 Returns the current view zoom (scale factor).
 

Detailed Description

Contains settings and helpers relating to a render of a QgsLayoutItem.

Definition at line 42 of file qgslayoutitem.h.

Constructor & Destructor Documentation

◆ QgsLayoutItemRenderContext() [1/2]

QgsLayoutItemRenderContext::QgsLayoutItemRenderContext ( QgsRenderContext context,
double  viewScaleFactor = 1.0 
)

Constructor for QgsLayoutItemRenderContext.

The renderContext parameter specifies a QgsRenderContext for use within the QgsLayoutItemRenderContext.

The viewScaleFactor gives the current view zoom (scale factor). It can be used to scale render graphics so that they always appear a constant size, regardless of the current view zoom.

Definition at line 40 of file qgslayoutitem.cpp.

◆ QgsLayoutItemRenderContext() [2/2]

QgsLayoutItemRenderContext::QgsLayoutItemRenderContext ( const QgsLayoutItemRenderContext other)
delete

Member Function Documentation

◆ operator=()

QgsLayoutItemRenderContext & QgsLayoutItemRenderContext::operator= ( const QgsLayoutItemRenderContext other)
delete

◆ renderContext() [1/2]

QgsRenderContext & QgsLayoutItemRenderContext::renderContext ( )
inline

Returns a reference to the context's render context.

Note that the context's painter has been scaled so that painter units are pixels. Use the QgsRenderContext methods to convert from millimeters or other units to the painter's units.

Definition at line 67 of file qgslayoutitem.h.

◆ renderContext() [2/2]

const QgsRenderContext & QgsLayoutItemRenderContext::renderContext ( ) const
inline

Returns a reference to the context's render context.

Note that the context's painter has been scaled so that painter units are pixels. Use the QgsRenderContext methods to convert from millimeters or other units to the painter's units.

Note
Not available in Python bindings.

Definition at line 77 of file qgslayoutitem.h.

◆ viewScaleFactor()

double QgsLayoutItemRenderContext::viewScaleFactor ( ) const
inline

Returns the current view zoom (scale factor).

It can be used to scale render graphics so that they always appear a constant size, regardless of the current view zoom.

E.g. a value of 0.5 indicates that the view is zoomed out to 50% size, so rendered items must be scaled by 200% in order to have a constant visible size. A value of 2.0 indicates that the view is zoomed in 200%, so rendered items must be scaled by 50% in order to have a constant visible size.

Definition at line 89 of file qgslayoutitem.h.


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