Class: QgsLayoutReportContext¶
Stores information relating to the current reporting context for a layout.
Class Hierarchy¶
Base classes¶
Methods
Returns the current   | 
|
Returns the current feature for evaluating the layout.  | 
|
Returns the vector layer associated with the layout's context.  | 
|
Returns the current list of predefined scales for use with the layout.  | 
|
Sets the current feature for evaluating the layout.  | 
|
Sets the vector layer associated with the layout's context.  | 
|
Sets the list of predefined scales to use with the layout.  | 
Signals
Emitted certain settings in the context is changed, e.g. by setting a new feature or vector layer for the context.  | 
|
Emitted when the context's layer is changed.  | 
- class qgis.core.QgsLayoutReportContext[source]¶
 Bases:
QObject- __init__(layout: QgsLayout | None)
 Constructor for QgsLayoutReportContext.
- Parameters:
 layout (Optional[QgsLayout])
- signal changed[source]¶
 Emitted certain settings in the context is changed, e.g. by setting a new feature or vector layer for the context.
- currentGeometry(self, crs: QgsCoordinateReferenceSystem = QgsCoordinateReferenceSystem()) QgsGeometry[source]¶
 Returns the current
feature()geometry in the givencrs. If no CRS is specified, the original feature geometry is returned.Reprojection only works if a valid layer is set for
layer().See also
See also
- Parameters:
 crs (
QgsCoordinateReferenceSystem= QgsCoordinateReferenceSystem())- Return type:
 
- feature(self) QgsFeature[source]¶
 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
See also
- Return type:
 
- layer(self) QgsVectorLayer | None[source]¶
 Returns the vector layer associated with the layout’s context.
See also
- Return type:
 Optional[QgsVectorLayer]
- signal layerChanged(layer: QgsVectorLayer)[source]¶
 Emitted when the context’s
layeris changed.- Parameters:
 layer (QgsVectorLayer)
- predefinedScales(self) List[float]¶
 Returns the current list of predefined scales for use with the layout.
See also
Deprecated since version 3.40: Use
QgsLayoutRenderContext.predefinedScales().- Return type:
 List[float]
- setFeature(self, feature: QgsFeature)[source]¶
 Sets the current
featurefor 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
- Parameters:
 feature (QgsFeature)
- setLayer(self, layer: QgsVectorLayer | None)[source]¶
 Sets the vector
layerassociated with the layout’s context.Emits the
changed()signal.See also
- Parameters:
 layer (Optional[QgsVectorLayer])
- setPredefinedScales(self, scales: Iterable[float])[source]¶
 Sets the list of predefined
scalesto use with the layout. This is used for maps which are set to the predefined atlas scaling mode.See also
Deprecated since version 3.40: Use
QgsLayoutRenderContext.setPredefinedScales().- Parameters:
 scales (Iterable[float])