Skip to content

Vector4D

Qt Base Class: QVector4D

Signature: QVector4D(self) -> None QVector4D(self, point: PySide6.QtCore.QPoint) -> None QVector4D(self, point: Union[PySide6.QtCore.QPointF, PySide6.QtCore.QPoint, PySide6.QtGui.QPainterPath.Element]) -> None QVector4D(self, vector: PySide6.QtGui.QVector2D) -> None QVector4D(self, vector: PySide6.QtGui.QVector2D, zpos: float, wpos: float) -> None QVector4D(self, vector: PySide6.QtGui.QVector3D) -> None QVector4D(self, vector: PySide6.QtGui.QVector3D, wpos: float) -> None QVector4D(self, xpos: float, ypos: float, zpos: float, wpos: float) -> None

Base classes

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

⋔ Inheritance diagram

graph TD
  1473245620704["gui.Vector4D"]
  1473299685216["QtGui.QVector4D"]
  1473291690208["Shiboken.Object"]
  140713234304496["builtins.object"]
  1473299685216 --> 1473245620704
  1473291690208 --> 1473299685216
  140713234304496 --> 1473291690208

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