Skip to content

Margins

Base classes

Name Children Inherits
QMargins
PySide6.QtCore
QMargins(self, /) -> None

⋔ Inheritance diagram

graph TD
  214682855["core.Margins"]
  1654967358["QtCore.QMargins"]
  37984305["Shiboken.Object"]
  2751680898["builtins.object"]
  1654967358 --> 214682855
  37984305 --> 1654967358
  2751680898 --> 37984305

🛈 DocStrings

Bases: QMargins

Defines the four margins of a rectangle.

Source code in prettyqt/core/margins.py
class Margins(QtCore.QMargins):
    """Defines the four margins of a rectangle."""

    def __repr__(self):
        return get_repr(self, self.left(), self.top(), self.right(), self.bottom())

    def __reduce__(self):
        return type(self), (self.left(), self.top(), self.right(), self.bottom())

    @property
    def _left(self) -> int:
        return self.left()

    @property
    def _top(self) -> int:
        return self.top()

    @property
    def _right(self) -> int:
        return self.right()

    @property
    def _bottom(self) -> int:
        return self.bottom()

    __match_args__ = ("_left", "_top", "_right", "_bottom")

    def __bool__(self):
        return not self.isNull()

    def __iter__(self) -> Iterator[int]:
        yield self.left()
        yield self.top()
        yield self.right()
        yield self.bottom()

:fa-brands-github: Show source on GitHub