Class: QgsPageSizeRegistry¶
A registry for known page sizes.
QgsPageSizeRegistry is not usually directly created, but
rather accessed through QgsApplication.pageSizeRegistry().
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. |
- class qgis.core.QgsPageSizeRegistry[source]¶
Bases:
object- __init__()
Creates a registry and populates it with known sizes
- __init__(a0: QgsPageSizeRegistry)
- Parameters:
a0 (QgsPageSizeRegistry)
- add(self, size: QgsPageSize)[source]¶
Adds a page
sizeto the registry.- Parameters:
size (QgsPageSize)
- decodePageSize(self, string: str | None, size: QgsPageSize) bool[source]¶
Decodes a
stringrepresenting a preset page size. The decoded page size will be stored in thesizeargument.- Return type:
bool
- Returns:
Trueif string was successfully decoded- Parameters:
string (Optional[str])
size (QgsPageSize)
- entries(self) List[QgsPageSize]¶
Returns a list of page sizes in the registry.
- Return type:
List[QgsPageSize]
- find(self, name: str | None) List[QgsPageSize][source]¶
Finds matching page sizes from the registry, using a case insensitive match on the page size
name.- Parameters:
name (Optional[str])
- Return type:
List[QgsPageSize]
- find(self, size: QgsLayoutSize) str[source]
Finds a matching page
sizefrom 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:
size (
QgsLayoutSize)- Return type:
str