Class: QgsLayoutAligner

Handles aligning and distributing sets of layout items.

QgsLayoutAligner contains methods for automatically aligning and distributing sets of layout items, e.g. aligning a group of items to top or left sides.

Static Methods

alignItems

Aligns a set of items from a layout in place.

distributeItems

Distributes a set of items from a layout in place.

resizeItems

Resizes a set of items from a layout in place.

Attributes

AlignBottom

AlignHCenter

AlignLeft

AlignRight

AlignTop

AlignVCenter

DistributeBottom

DistributeHCenter

DistributeHSpace

DistributeLeft

DistributeRight

DistributeTop

DistributeVCenter

DistributeVSpace

ResizeNarrowest

ResizeShortest

ResizeTallest

ResizeToSquare

ResizeWidest

class qgis.core.QgsLayoutAligner[source]

Bases: object

AlignBottom = 5
AlignHCenter = 1
AlignLeft = 0
AlignRight = 2
AlignTop = 3
AlignVCenter = 4
class Alignment

Bases: int

DistributeBottom = 7
DistributeHCenter = 1
DistributeHSpace = 2
DistributeLeft = 0
DistributeRight = 3
DistributeTop = 4
DistributeVCenter = 5
DistributeVSpace = 6
class Distribution

Bases: int

class Resize

Bases: int

ResizeNarrowest = 0
ResizeShortest = 2
ResizeTallest = 3
ResizeToSquare = 4
ResizeWidest = 1
static alignItems(layout: QgsLayout | None, items: Iterable[QgsLayoutItem], alignment: QgsLayoutAligner.Alignment)[source]

Aligns a set of items from a layout in place.

The alignment argument specifies the method to use when aligning the items.

Parameters:
static distributeItems(layout: QgsLayout | None, items: Iterable[QgsLayoutItem], distribution: QgsLayoutAligner.Distribution)[source]

Distributes a set of items from a layout in place.

The distribution argument specifies the method to use when distributing the items.

Parameters:
static resizeItems(layout: QgsLayout | None, items: Iterable[QgsLayoutItem], resize: QgsLayoutAligner.Resize)[source]

Resizes a set of items from a layout in place.

The resize argument specifies the method to use when resizing the items.

Parameters: