Skip to content

PageLayout

Qt Base Class: QPageLayout

Signature: QPageLayout(self) -> None QPageLayout(self, other: PySide6.QtGui.QPageLayout) -> None QPageLayout(self, pageSize: Union[PySide6.QtGui.QPageSize, PySide6.QtGui.QPageSize.PageSizeId, PySide6.QtCore.QSize], orientation: PySide6.QtGui.QPageLayout.Orientation, margins: Union[PySide6.QtCore.QMarginsF, PySide6.QtCore.QMargins], units: PySide6.QtGui.QPageLayout.Unit = Instance(QPageLayout.Unit.Point), minMargins: Union[PySide6.QtCore.QMarginsF, PySide6.QtCore.QMargins] = Instance(QMarginsF(0, 0, 0, 0))) -> None

Base classes

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

⋔ Inheritance diagram

graph TD
  1473245606064["gui.PageLayout"]
  1473289190048["QtGui.QPageLayout"]
  1473291690208["Shiboken.Object"]
  140713234304496["builtins.object"]
  1473289190048 --> 1473245606064
  1473291690208 --> 1473289190048
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: QPageLayout

Describes the size, orientation and margins of a page.

Source code in prettyqt\gui\pagelayout.py
class PageLayout(gui.QPageLayout):
    """Describes the size, orientation and margins of a page."""

    def __repr__(self):
        return get_repr(self)

    def set_units(self, unit: UnitStr | gui.QPageLayout.Unit):
        """Set unit.

        Args:
            unit: unit
        """
        self.setUnits(UNITS.get_enum_value(unit))

    def get_units(self) -> UnitStr:
        """Get the current unit.

        Returns:
            unit
        """
        return UNITS.inverse[self.units()]

    def set_mode(self, mode: ModeStr | gui.QPageLayout.Mode):
        """Set mode.

        Args:
            mode: mode
        """
        self.setMode(MODES.get_enum_value(mode))

    def get_mode(self) -> ModeStr:
        """Get the current mode.

        Returns:
            mode
        """
        return MODES.inverse[self.mode()]

    def set_orientation(self, orientation: OrientationStr | gui.QPageLayout.Orientation):
        """Set orientation.

        Args:
            orientation: orientation
        """
        self.setOrientation(ORIENTATIONS.get_enum_value(orientation))

    def get_orientation(self) -> OrientationStr:
        """Get the current orientation.

        Returns:
            orientation
        """
        return ORIENTATIONS.inverse[self.orientation()]

    def get_page_size(self) -> gui.PageSize:
        return gui.PageSize(self.pageSize())

get_mode() -> ModeStr

Get the current mode.

Source code in prettyqt\gui\pagelayout.py
def get_mode(self) -> ModeStr:
    """Get the current mode.

    Returns:
        mode
    """
    return MODES.inverse[self.mode()]

get_orientation() -> OrientationStr

Get the current orientation.

Source code in prettyqt\gui\pagelayout.py
def get_orientation(self) -> OrientationStr:
    """Get the current orientation.

    Returns:
        orientation
    """
    return ORIENTATIONS.inverse[self.orientation()]

get_units() -> UnitStr

Get the current unit.

Source code in prettyqt\gui\pagelayout.py
def get_units(self) -> UnitStr:
    """Get the current unit.

    Returns:
        unit
    """
    return UNITS.inverse[self.units()]

set_mode(mode: ModeStr | gui.QPageLayout.Mode)

Set mode.

Parameters:

Name Type Description Default
mode ModeStr | Mode

mode

required
Source code in prettyqt\gui\pagelayout.py
def set_mode(self, mode: ModeStr | gui.QPageLayout.Mode):
    """Set mode.

    Args:
        mode: mode
    """
    self.setMode(MODES.get_enum_value(mode))

set_orientation(orientation: OrientationStr | gui.QPageLayout.Orientation)

Set orientation.

Parameters:

Name Type Description Default
orientation OrientationStr | Orientation

orientation

required
Source code in prettyqt\gui\pagelayout.py
def set_orientation(self, orientation: OrientationStr | gui.QPageLayout.Orientation):
    """Set orientation.

    Args:
        orientation: orientation
    """
    self.setOrientation(ORIENTATIONS.get_enum_value(orientation))

set_units(unit: UnitStr | gui.QPageLayout.Unit)

Set unit.

Parameters:

Name Type Description Default
unit UnitStr | Unit

unit

required
Source code in prettyqt\gui\pagelayout.py
def set_units(self, unit: UnitStr | gui.QPageLayout.Unit):
    """Set unit.

    Args:
        unit: unit
    """
    self.setUnits(UNITS.get_enum_value(unit))