Class: QgsPageSizeRegistry¶
- class qgis.core.QgsPageSizeRegistry¶
Bases:
sip.wrapper
A registry for known page sizes.
QgsPageSizeRegistry
is not usually directly created, but rather accessed throughQgsApplication.pageSizeRegistry()
.New in version 3.0.
QgsPageSizeRegistry() Creates a registry and populates it with known sizes
QgsPageSizeRegistry(
QgsPageSizeRegistry
)Methods
Adds a page
size
to the registry.Decodes a
string
representing a preset page size.Returns a list of page sizes in the registry.
Finds matching page sizes from the registry, using a case insensitive match on the page size
name
.- add(self, size: QgsPageSize)¶
Adds a page
size
to the registry.- Parameters
size (QgsPageSize) –
- decodePageSize(self, string: str, size: QgsPageSize) bool ¶
Decodes a
string
representing a preset page size. The decoded page size will be stored in thesize
argument.- Return type
bool
- Returns
True
if string was successfully decoded- Parameters
string (str) –
size (QgsPageSize) –
- entries(self) List[QgsPageSize] ¶
Returns a list of page sizes in the registry.
- Return type
List[QgsPageSize]
- find(self, name: str) List[QgsPageSize] ¶
Finds matching page sizes from the registry, using a case insensitive match on the page size
name
.find(self, size:
QgsLayoutSize
) -> str Finds a matching pagesize
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.
- Parameters
name (str) –
- Return type
List[QgsPageSize]