Skip to content

PageSize

Qt Base Class: QPageSize

Signature: QPageSize(self) -> None QPageSize(self, other: Union[PySide6.QtGui.QPageSize, PySide6.QtGui.QPageSize.PageSizeId, PySide6.QtCore.QSize]) -> None QPageSize(self, pageSizeId: PySide6.QtGui.QPageSize.PageSizeId) -> None QPageSize(self, pointSize: PySide6.QtCore.QSize, name: str = '', matchPolicy: PySide6.QtGui.QPageSize.SizeMatchPolicy = Instance(QPageSize.SizeMatchPolicy.FuzzyMatch)) -> None QPageSize(self, size: Union[PySide6.QtCore.QSizeF, PySide6.QtCore.QSize], units: PySide6.QtGui.QPageSize.Unit, name: str = '', matchPolicy: PySide6.QtGui.QPageSize.SizeMatchPolicy = Instance(QPageSize.SizeMatchPolicy.FuzzyMatch)) -> None

Base classes

Name Children Inherits
QPageSize
PySide6.QtGui
QPageSize(self) -> None

⋔ Inheritance diagram

graph TD
  1473245572880["gui.PageSize"]
  1473300091152["QtGui.QPageSize"]
  1473291690208["Shiboken.Object"]
  140713234304496["builtins.object"]
  1473300091152 --> 1473245572880
  1473291690208 --> 1473300091152
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: QPageSize

Describes the size and name of a defined page size.

Source code in prettyqt\gui\pagesize.py
class PageSize(QtGui.QPageSize):
    """Describes the size and name of a defined page size."""

    def __repr__(self):
        return get_repr(self, self.get_id())

    def __reduce__(self):
        return type(self), (self.id(),)

    def get_definition_units(self) -> UnitStr:
        """Get the definition unit.

        Returns:
            unit
        """
        units = self.definitionUnits()
        if units.value == -1:
            raise ValueError("Invalid page size")
        return UNITS.inverse[units]

    def get_id(self) -> str:
        """Get the standard page size id.

        Returns:
            page size id
        """
        return PAGE_SIZE_ID.inverse[self.id()]

get_definition_units() -> UnitStr

Get the definition unit.

Source code in prettyqt\gui\pagesize.py
def get_definition_units(self) -> UnitStr:
    """Get the definition unit.

    Returns:
        unit
    """
    units = self.definitionUnits()
    if units.value == -1:
        raise ValueError("Invalid page size")
    return UNITS.inverse[units]

get_id() -> str

Get the standard page size id.

Source code in prettyqt\gui\pagesize.py
def get_id(self) -> str:
    """Get the standard page size id.

    Returns:
        page size id
    """
    return PAGE_SIZE_ID.inverse[self.id()]