Skip to content

PythonQt.QtGui.QVector2D · declarations 001

Back to PythonQt.QtGui.QVector2D

distanceToLine

distanceToLine(point: Any, direction: Any) -> float

X.distanceToLine(point, direction) -> float

Supplemental documentation: Qt 5 reference:

float QVector2D::distanceToLine(const QVector2D \&point, const QVector2D \&direction) const

Returns the distance that this vertex is from a line defined by point and the unit vector direction.

If direction is a null vector, then it does not define a line. In that case, the distance from point to this vertex is returned.

This function was introduced in Qt 5.1.

See also distanceToPoint().

Upstream PySide2 reference signatures (binding differences may apply):

distanceToLine(self, point: PySide2.QtGui.QVector2D, direction: PySide2.QtGui.QVector2D) -> float

Source: https://doc.qt.io/archives/qt-5.15/qvector2d.html#distanceToLine

distanceToPoint

distanceToPoint(point: Any) -> float

X.distanceToPoint(point) -> float

Supplemental documentation: Qt 5 reference:

float QVector2D::distanceToPoint(const QVector2D \&point) const

Returns the distance from this vertex to a point defined by the vertex point.

This function was introduced in Qt 5.1.

See also distanceToLine().

Upstream PySide2 reference signatures (binding differences may apply):

distanceToPoint(self, point: PySide2.QtGui.QVector2D) -> float

Source: https://doc.qt.io/archives/qt-5.15/qvector2d.html#distanceToPoint

dotProduct

dotProduct(v1: Any, v2: Any) -> float

X.dotProduct(v1, v2) -> float

Supplemental documentation: Qt 5 reference:

[static] float QVector2D::dotProduct(const QVector2D \&v1, const QVector2D \&v2)

Returns the dot product of v1 and v2.

Upstream PySide2 reference signatures (binding differences may apply):

dotProduct(v1: PySide2.QtGui.QVector2D, v2: PySide2.QtGui.QVector2D) -> float

Source: https://doc.qt.io/archives/qt-5.15/qvector2d.html#dotProduct

isNull

isNull() -> bool

X.isNull() -> bool

Supplemental documentation: Qt 5 reference:

bool QVector2D::isNull() const

Returns true if the x and y coordinates are set to 0.0, otherwise returns false.

Upstream PySide2 reference signatures (binding differences may apply):

isNull(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qvector2d.html#isNull

length

length() -> float

X.length() -> float

Supplemental documentation: Qt 5 reference:

float QVector2D::length() const

Returns the length of the vector from the origin.

See also lengthSquared() and normalized().

Upstream PySide2 reference signatures (binding differences may apply):

length(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qvector2d.html#length

lengthSquared

lengthSquared() -> float

X.lengthSquared() -> float

Supplemental documentation: Qt 5 reference:

float QVector2D::lengthSquared() const

Returns the squared length of the vector from the origin. This is equivalent to the dot product of the vector with itself.

See also length() and dotProduct().

Upstream PySide2 reference signatures (binding differences may apply):

lengthSquared(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qvector2d.html#lengthSquared

normalize

normalize() -> None

X.normalize()

Supplemental documentation: Qt 5 reference:

void QVector2D::normalize()

Normalizes the currect vector in place. Nothing happens if this vector is a null vector or the length of the vector is very close to 1.

See also length() and normalized().

Upstream PySide2 reference signatures (binding differences may apply):

normalize(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qvector2d.html#normalize

normalized

normalized() -> Any

X.normalized() -> PythonQt.QtGui.QVector2D

Supplemental documentation: Qt 5 reference:

QVector2D QVector2D::normalized() const

Returns the normalized unit vector form of this vector.

If this vector is null, then a null vector is returned. If the length of the vector is very close to 1, then the vector will be returned as-is. Otherwise the normalized form of the vector of length 1 will be returned.

See also length() and normalize().

Upstream PySide2 reference signatures (binding differences may apply):

normalized(self) -> PySide2.QtGui.QVector2D

Source: https://doc.qt.io/archives/qt-5.15/qvector2d.html#normalized

operator_subscript

operator_subscript(i: Any) -> float

X.operator_subscript(i) -> float

setX

setX(x: float) -> None

X.setX(x)

Supplemental documentation: Qt 5 reference:

void QVector2D::setX(float x)

Sets the x coordinate of this point to the given x coordinate.

See also x() and setY().

Upstream PySide2 reference signatures (binding differences may apply):

setX(self, x: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qvector2d.html#setX

setY

setY(y: float) -> None

X.setY(y)

Supplemental documentation: Qt 5 reference:

void QVector2D::setY(float y)

Sets the y coordinate of this point to the given y coordinate.

See also y() and setX().

Upstream PySide2 reference signatures (binding differences may apply):

setY(self, y: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qvector2d.html#setY

toPoint

toPoint() -> Any

X.toPoint() -> PythonQt.QtCore.QPoint

Supplemental documentation: Qt 5 reference:

QPoint QVector2D::toPoint() const

Returns the QPoint form of this 2D vector.

See also toPointF() and toVector3D().

Upstream PySide2 reference signatures (binding differences may apply):

toPoint(self) -> PySide2.QtCore.QPoint

Source: https://doc.qt.io/archives/qt-5.15/qvector2d.html#toPoint

toPointF

toPointF() -> Any

X.toPointF() -> PythonQt.QtCore.QPointF

Supplemental documentation: Qt 5 reference:

QPointF QVector2D::toPointF() const

Returns the QPointF form of this 2D vector.

See also toPoint() and toVector3D().

Upstream PySide2 reference signatures (binding differences may apply):

toPointF(self) -> PySide2.QtCore.QPointF

Source: https://doc.qt.io/archives/qt-5.15/qvector2d.html#toPointF

toVector3D

toVector3D() -> Any

X.toVector3D() -> PythonQt.QtGui.QVector3D

Supplemental documentation: Qt 5 reference:

QVector3D QVector2D::toVector3D() const

Returns the 3D form of this 2D vector, with the z coordinate set to zero.

See also toVector4D() and toPoint().

Upstream PySide2 reference signatures (binding differences may apply):

toVector3D(self) -> PySide2.QtGui.QVector3D

Source: https://doc.qt.io/archives/qt-5.15/qvector2d.html#toVector3D

toVector4D

toVector4D() -> Any

X.toVector4D() -> PythonQt.QtGui.QVector4D

Supplemental documentation: Qt 5 reference:

QVector4D QVector2D::toVector4D() const

Returns the 4D form of this 2D vector, with the z and w coordinates set to zero.

See also toVector3D() and toPoint().

Upstream PySide2 reference signatures (binding differences may apply):

toVector4D(self) -> PySide2.QtGui.QVector4D

Source: https://doc.qt.io/archives/qt-5.15/qvector2d.html#toVector4D

x

x() -> float

X.x() -> float

Supplemental documentation: Qt 5 reference:

float QVector2D::x() const

Returns the x coordinate of this point.

See also setX() and y().

Upstream PySide2 reference signatures (binding differences may apply):

x(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qvector2d.html#x

y

y() -> float

X.y() -> float

Supplemental documentation: Qt 5 reference:

float QVector2D::y() const

Returns the y coordinate of this point.

See also setY() and x().

Upstream PySide2 reference signatures (binding differences may apply):

y(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qvector2d.html#y