Class: QgsLayoutReportContext

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

Class Hierarchy

Inheritance diagram of qgis.core.QgsLayoutReportContext

Base classes

QObject

class qgis.core.QgsLayoutReportContext[source]

Bases: QObject

__init__(layout: QgsLayout | None)

Constructor for QgsLayoutReportContext.

Parameters:

layout (Optional[QgsLayout])

signal changed[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

currentGeometry(self, crs: QgsCoordinateReferenceSystem = QgsCoordinateReferenceSystem()) QgsGeometry[source]

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()

See also

layer()

Parameters:

crs (QgsCoordinateReferenceSystem = QgsCoordinateReferenceSystem())

Return type:

QgsGeometry

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

setFeature()

Return type:

QgsFeature

layer(self) QgsVectorLayer | None[source]

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

See also

setLayer()

Return type:

Optional[QgsVectorLayer]

signal layerChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

predefinedScales(self) List[float]

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

Deprecated since version 3.40: Use QgsLayoutRenderContext.predefinedScales().

Return type:

List[float]

setFeature(self, feature: QgsFeature)[source]

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()

Parameters:

feature (QgsFeature)

setLayer(self, layer: QgsVectorLayer | None)[source]

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

Emits the changed() signal.

See also

layer()

Parameters:

layer (Optional[QgsVectorLayer])

setPredefinedScales(self, scales: Iterable[float])[source]

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.

Deprecated since version 3.40: Use QgsLayoutRenderContext.setPredefinedScales().

Parameters:

scales (Iterable[float])