Skip to content

Vector4D

Base classes

Name Children Inherits
QVector4D
PySide6.QtGui
QVector4D(self, /) -> None

⋔ Inheritance diagram

graph TD
  2224406594["gui.Vector4D"]
  2576633359["QtGui.QVector4D"]
  37984305["Shiboken.Object"]
  2751680898["builtins.object"]
  2576633359 --> 2224406594
  37984305 --> 2576633359
  2751680898 --> 37984305

🛈 DocStrings

Bases: QVector4D

Source code in prettyqt/gui/vector4d.py
class Vector4D(QtGui.QVector4D):
    def __bool__(self):
        return not self.isNull()

    def __abs__(self) -> float:
        return self.length()

    @property
    def _x(self) -> float:
        return self.x()

    @property
    def _y(self) -> float:
        return self.y()

    @property
    def _z(self) -> float:
        return self.z()

    @property
    def _w(self) -> float:
        return self.w()

    __match_args__ = ("_x", "_y", "z", "w")

    def __reduce__(self):
        return type(self), (self.x(), self.y(), self.z(), self.w())

    def to_point(self) -> core.Point:
        return core.Point(self.toPoint())

    def to_pointf(self) -> core.PointF:
        return core.PointF(self.toPointF())

:fa-brands-github: Show source on GitHub