Class: QgsLayoutReportContext

class qgis.core.QgsLayoutReportContext

Bases: PyQt5.QtCore.QObject

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

New in version 3.0.

QgsLayoutReportContext(layout: QgsLayout) Constructor for QgsLayoutReportContext.

Methods

childEvent

connectNotify

currentGeometry

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

customEvent

disconnectNotify

feature

Returns the current feature for evaluating the layout.

isSignalConnected

layer

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

predefinedScales

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

receivers

sender

senderSignalIndex

setFeature

Sets the current feature for evaluating the layout.

setLayer

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

setPredefinedScales

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

timerEvent

Signals

changed

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

layerChanged

Emitted when the context’s layer is changed.

changed

Emitted certain settings in the context is changed, e.g. by setting a new feature or vector layer for the context. [signal]

childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
currentGeometry(self, crs: QgsCoordinateReferenceSystem = QgsCoordinateReferenceSystem())QgsGeometry

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

customEvent(self, QEvent)
disconnectNotify(self, QMetaMethod)
feature(self)QgsFeature

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

isSignalConnected(self, QMetaMethod)bool
layer(self)QgsVectorLayer

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

See also

setLayer()

Return type

QgsVectorLayer

layerChanged

Emitted when the context’s layer is changed. [signal]

Parameters

layer (QgsVectorLayer) –

predefinedScales(self)List[float]

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

Deprecated since version Use: QgsLayoutRenderContext.predefinedScales()

Return type

List[float]

receivers(self, PYQT_SIGNAL)int
sender(self)QObject
senderSignalIndex(self)int
setFeature(self, feature: QgsFeature)

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)

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

Emits the changed() signal.

See also

layer()

Parameters

layer (QgsVectorLayer) –

setPredefinedScales(self, scales: Iterable[float])

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 Use: QgsLayoutRenderContext.setPredefinedScales()

Parameters

scales (Iterable[float]) –

timerEvent(self, QTimerEvent)