Class: QgsAbstractLayoutIterator

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

Note

This is an abstract class, with methods which must be implemented by a subclass.

The following methods must be implemented: beginRender(), count(), endRender(), filePath(), layout(), next()

Class Hierarchy

Inheritance diagram of qgis.core.QgsAbstractLayoutIterator

Subclasses

QgsAbstractReportSection

An abstract base class for QgsReport subsections.

QgsLayoutAtlas

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

Abstract 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

abstract 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

abstract count(self) int[source]

Returns the number of features to iterate over.

Return type:

int

abstract endRender(self) bool[source]

Ends the render, performing any required cleanup tasks.

Return type:

bool

abstract 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

abstract layout(self) QgsLayout | None[source]

Returns the layout associated with the iterator.

Return type:

Optional[QgsLayout]

abstract next(self) bool[source]

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

Return type:

bool