QgsPageSizeRegistry class

A registry for known page sizes.

QgsPageSizeRegistry is not usually directly created, but rather accessed through QgsApplication::pageSizeRegistry().

Constructors, destructors, conversion operators

QgsPageSizeRegistry()
Creates a registry and populates it with known sizes.

Public functions

void add(const QgsPageSize& size)
Adds a page size to the registry.
auto decodePageSize(const QString& string, QgsPageSize& size) -> bool
Decodes a string representing a preset page size.
auto entries() const -> QList<QgsPageSize>
Returns a list of page sizes in the registry.
auto find(const QString& name) const -> QList<QgsPageSize>
Finds matching page sizes from the registry, using a case insensitive match on the page size name.
auto find(const QgsLayoutSize& size) const -> QString
Finds a matching page size from the registry.

Function documentation

bool QgsPageSizeRegistry::decodePageSize(const QString& string, QgsPageSize& size)

Decodes a string representing a preset page size.

Returns true if string was successfully decoded

The decoded page size will be stored in the size argument.

QString QgsPageSizeRegistry::find(const QgsLayoutSize& size) const

Finds a matching page size from the registry.

Returns the page size name, or an empty string if no matching size could be found.

Orientation is ignored when matching page sizes, so a landscape A4 page will match to the portrait A4 size in the registry.