QGIS API Documentation 3.30.0-'s-Hertogenbosch (f186b8efe0)
Signals | Public Member Functions | Friends | List of all members
QgsLayoutReportContext Class Reference

Stores information relating to the current reporting context for a layout. More...

#include <qgslayoutreportcontext.h>

Inheritance diagram for QgsLayoutReportContext:
Inheritance graph
[legend]

Signals

void changed ()
 Emitted certain settings in the context is changed, e.g. More...
 
void layerChanged (QgsVectorLayer *layer)
 Emitted when the context's layer is changed. More...
 

Public Member Functions

 QgsLayoutReportContext (QgsLayout *layout)
 Constructor for QgsLayoutReportContext. More...
 
QgsGeometry currentGeometry (const QgsCoordinateReferenceSystem &crs=QgsCoordinateReferenceSystem()) const
 Returns the current feature() geometry in the given crs. More...
 
QgsFeature feature () const
 Returns the current feature for evaluating the layout. More...
 
QgsVectorLayerlayer () const
 Returns the vector layer associated with the layout's context. More...
 
Q_DECL_DEPRECATED QVector< qreal > predefinedScales () const
 Returns the current list of predefined scales for use with the layout. More...
 
void setFeature (const QgsFeature &feature)
 Sets the current feature for evaluating the layout. More...
 
void setLayer (QgsVectorLayer *layer)
 Sets the vector layer associated with the layout's context. More...
 
Q_DECL_DEPRECATED void setPredefinedScales (const QVector< qreal > &scales)
 Sets the list of predefined scales to use with the layout. More...
 

Friends

class QgsLayoutExporter
 
class TestQgsLayout
 

Detailed Description

Stores information relating to the current reporting context for a layout.

Since
QGIS 3.0

Definition at line 32 of file qgslayoutreportcontext.h.

Constructor & Destructor Documentation

◆ QgsLayoutReportContext()

QgsLayoutReportContext::QgsLayoutReportContext ( QgsLayout layout)

Constructor for QgsLayoutReportContext.

Definition at line 22 of file qgslayoutreportcontext.cpp.

Member Function Documentation

◆ changed

void QgsLayoutReportContext::changed ( )
signal

Emitted certain settings in the context is changed, e.g.

by setting a new feature or vector layer for the context.

◆ currentGeometry()

QgsGeometry QgsLayoutReportContext::currentGeometry ( const QgsCoordinateReferenceSystem crs = QgsCoordinateReferenceSystem()) const

Returns the current feature() geometry in the given crs.

If no CRS is specified, the original feature geometry is returned.

Reprojection only works if a valid layer is set for layer().

See also
feature()
layer()

Definition at line 34 of file qgslayoutreportcontext.cpp.

◆ feature()

QgsFeature QgsLayoutReportContext::feature ( ) const
inline

Returns the current feature for evaluating the layout.

This feature may be used for altering an item's content and appearance for a report or atlas layout.

See also
currentGeometry()
setFeature()

Definition at line 62 of file qgslayoutreportcontext.h.

◆ layer()

QgsVectorLayer * QgsLayoutReportContext::layer ( ) const

Returns the vector layer associated with the layout's context.

See also
setLayer()

Definition at line 66 of file qgslayoutreportcontext.cpp.

◆ layerChanged

void QgsLayoutReportContext::layerChanged ( QgsVectorLayer layer)
signal

Emitted when the context's layer is changed.

◆ predefinedScales()

Q_DECL_DEPRECATED QVector< qreal > QgsLayoutReportContext::predefinedScales ( ) const
inline

Returns the current list of predefined scales for use with the layout.

See also
setPredefinedScales()
Deprecated:
Use QgsLayoutRenderContext::predefinedScales()

Definition at line 103 of file qgslayoutreportcontext.h.

◆ setFeature()

void QgsLayoutReportContext::setFeature ( const QgsFeature feature)

Sets the current feature for evaluating the layout.

This feature may be used for altering an item's content and appearance for a report or atlas layout.

Emits the changed() signal.

See also
feature()

Definition at line 27 of file qgslayoutreportcontext.cpp.

◆ setLayer()

void QgsLayoutReportContext::setLayer ( QgsVectorLayer layer)

Sets the vector layer associated with the layout's context.

Emits the changed() signal.

See also
layer()

Definition at line 71 of file qgslayoutreportcontext.cpp.

◆ setPredefinedScales()

void QgsLayoutReportContext::setPredefinedScales ( const QVector< qreal > &  scales)

Sets the list of predefined scales to use with the layout.

This is used for maps which are set to the predefined atlas scaling mode.

See also
predefinedScales()
Deprecated:
Use QgsLayoutRenderContext::setPredefinedScales()

Definition at line 78 of file qgslayoutreportcontext.cpp.

Friends And Related Function Documentation

◆ QgsLayoutExporter

friend class QgsLayoutExporter
friend

Definition at line 131 of file qgslayoutreportcontext.h.

◆ TestQgsLayout

friend class TestQgsLayout
friend

Definition at line 132 of file qgslayoutreportcontext.h.


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