QGIS API Documentation 3.41.0-Master (25ec5511245)
Loading...
Searching...
No Matches
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.
 
void layerChanged (QgsVectorLayer *layer)
 Emitted when the context's layer is changed.
 

Public Member Functions

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

Friends

class QgsLayoutExporter
 
class TestQgsLayout
 

Detailed Description

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

Definition at line 31 of file qgslayoutreportcontext.h.

Constructor & Destructor Documentation

◆ QgsLayoutReportContext()

QgsLayoutReportContext::QgsLayoutReportContext ( QgsLayout layout)

Constructor for QgsLayoutReportContext.

Definition at line 23 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 35 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 61 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 67 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:
QGIS 3.40. Use QgsLayoutRenderContext::predefinedScales().

Definition at line 102 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 28 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 72 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:
QGIS 3.40. Use QgsLayoutRenderContext::setPredefinedScales().

Definition at line 79 of file qgslayoutreportcontext.cpp.

Friends And Related Symbol Documentation

◆ QgsLayoutExporter

friend class QgsLayoutExporter
friend

Definition at line 130 of file qgslayoutreportcontext.h.

◆ TestQgsLayout

friend class TestQgsLayout
friend

Definition at line 131 of file qgslayoutreportcontext.h.


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