Class: QgsAbstractLayoutIterator

An abstract base class for QgsLayout based classes which can be exported by QgsLayoutExporter.

Class Hierarchy

Inheritance diagram of qgis.core.QgsAbstractLayoutIterator

Subclasses

QgsAbstractReportSection

An abstract base class for QgsReport subsections.

QgsLayoutAtlas

Class used to render QgsLayout as an atlas, by iterating over the features from an associated vector layer.

Methods

beginRender

Called when rendering begins, before iteration commences.

count

Returns the number of features to iterate over.

endRender

Ends the render, performing any required cleanup tasks.

filePath

Returns the file path for the current feature, based on a specified base file path and extension.

layout

Returns the layout associated with the iterator.

next

Iterates to next feature, returning False if no more features exist to iterate over.

class qgis.core.QgsAbstractLayoutIterator[source]

Bases: object

beginRender(self) bool[source]

Called when rendering begins, before iteration commences. Returns True if successful, False if no iteration is available or required.

See also

endRender()

Return type:

bool

count(self) int[source]

Returns the number of features to iterate over.

Return type:

int

endRender(self) bool[source]

Ends the render, performing any required cleanup tasks.

Return type:

bool

filePath(self, baseFilePath: str | None, extension: str | None) str[source]

Returns the file path for the current feature, based on a specified base file path and extension.

Parameters:
  • baseFilePath (Optional[str])

  • extension (Optional[str])

Return type:

str

layout(self) QgsLayout | None[source]

Returns the layout associated with the iterator.

Return type:

Optional[QgsLayout]

next(self) bool[source]

Iterates to next feature, returning False if no more features exist to iterate over.

Return type:

bool