Skip to content

Vector3D

Base classes

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

⋔ Inheritance diagram

graph TD
  3807331078["gui.Vector3D"]
  3604338888["QtGui.QVector3D"]
  37984305["Shiboken.Object"]
  2751680898["builtins.object"]
  3604338888 --> 3807331078
  37984305 --> 3604338888
  2751680898 --> 37984305

🛈 DocStrings

Bases: QVector3D

Source code in prettyqt/gui/vector3d.py
class Vector3D(QtGui.QVector3D):
    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()

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

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

    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