Skip to content

Margins

Qt Base Class: QMargins

Signature: QMargins(self) -> None QMargins(self, QMargins: PySide6.QtCore.QMargins) -> None QMargins(self, left: int, top: int, right: int, bottom: int) -> None

Base classes

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

⋔ Inheritance diagram

graph TD
  1473299790624["core.Margins"]
  1473243840832["QtCore.QMargins"]
  1473291690208["Shiboken.Object"]
  140713234304496["builtins.object"]
  1473243840832 --> 1473299790624
  1473291690208 --> 1473243840832
  140713234304496 --> 1473291690208

🛈 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()