Skip to content

PythonQt.QtGui.QMatrix4x4 · declarations 001

Back to PythonQt.QtGui.QMatrix4x4

column

column(index: int) -> Any

X.column(index) -> PythonQt.QtGui.QVector4D

Supplemental documentation: Qt 5 reference:

QVector4D QMatrix4x4::column(int index) const

Returns the elements of column index as a 4D vector.

See also setColumn() and row().

Upstream PySide2 reference signatures (binding differences may apply):

column(self, index: int) -> PySide2.QtGui.QVector4D

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#column

constData

constData() -> float

X.constData() -> float

Supplemental documentation: Qt 5 reference:

const float *QMatrix4x4::constData() const

Returns a constant pointer to the raw data of this matrix. This raw data is stored in column-major format.

See also data().

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#constData

copyDataTo

copyDataTo(values: Any) -> float

X.copyDataTo(values)

Supplemental documentation: Qt 5 reference:

void QMatrix4x4::copyDataTo(float *values) const

Retrieves the 16 items in this matrix and copies them to values in row-major order.

Upstream PySide2 reference signatures (binding differences may apply):

copyDataTo(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#copyDataTo

data

data() -> float

X.data() -> float

Supplemental documentation: Qt 5 reference:

float *QMatrix4x4::data()

Returns a pointer to the raw data of this matrix.

See also constData() and optimize().

const float *QMatrix4x4::data() const

Returns a constant pointer to the raw data of this matrix. This raw data is stored in column-major format.

See also constData().

Upstream PySide2 reference signatures (binding differences may apply):

data(self) -> typing.List[float]

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#data

determinant

determinant() -> float

X.determinant() -> float

Supplemental documentation: Qt 5 reference:

double QMatrix4x4::determinant() const

Returns the determinant of this matrix.

Upstream PySide2 reference signatures (binding differences may apply):

determinant(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#determinant

fill

fill(value: float) -> None

X.fill(value)

Supplemental documentation: Qt 5 reference:

void QMatrix4x4::fill(float value)

Fills all elements of this matrx with value.

Upstream PySide2 reference signatures (binding differences may apply):

fill(self, value: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#fill

flipCoordinates

flipCoordinates() -> None

X.flipCoordinates()

Upstream PySide2 reference signatures (binding differences may apply):

flipCoordinates(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#flipCoordinates

frustum

frustum(left: float, right: float, bottom: float, top: float, nearPlane: float, farPlane: float) -> None

X.frustum(left, right, bottom, top, nearPlane, farPlane)

Supplemental documentation: Qt 5 reference:

void QMatrix4x4::frustum(float left, float right, float bottom, float top, float nearPlane, float farPlane)

Multiplies this matrix by another that applies a perspective frustum projection for a window with lower-left corner (left, bottom), upper-right corner (right, top), and the specified nearPlane and farPlane clipping planes.

See also ortho() and perspective().

Upstream PySide2 reference signatures (binding differences may apply):

frustum(self, left: float, right: float, bottom: float, top: float, nearPlane: float, farPlane: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#frustum

inverted

inverted(invertible: Any) -> Any

X.inverted(invertible) -> PythonQt.QtGui.QMatrix4x4

Supplemental documentation: Qt 5 reference:

QMatrix4x4 QMatrix4x4::inverted(bool *invertible \= nullptr) const

Returns the inverse of this matrix. Returns the identity if this matrix cannot be inverted; i.e. determinant() is zero. If invertible is not null, then true will be written to that location if the matrix can be inverted; false otherwise.

If the matrix is recognized as the identity or an orthonormal matrix, then this function will quickly invert the matrix using optimized routines.

See also determinant() and normalMatrix().

Upstream PySide2 reference signatures (binding differences may apply):

inverted(self) -> typing.Tuple[PySide2.QtGui.QMatrix4x4, bool]

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#inverted

isAffine

isAffine() -> bool

X.isAffine() -> bool

Supplemental documentation: Qt 5 reference:

bool QMatrix4x4::isAffine() const

Returns true if this matrix is affine matrix; false otherwise.

An affine matrix is a 4x4 matrix with row 3 equal to (0, 0, 0, 1), e.g. no projective coefficients.

This function was introduced in Qt 5.5.

See also isIdentity().

Upstream PySide2 reference signatures (binding differences may apply):

isAffine(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#isAffine

isIdentity

isIdentity() -> bool

X.isIdentity() -> bool

Supplemental documentation: Qt 5 reference:

bool QMatrix4x4::isIdentity() const

Returns true if this matrix is the identity; false otherwise.

See also setToIdentity().

Upstream PySide2 reference signatures (binding differences may apply):

isIdentity(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#isIdentity

lookAt

lookAt(eye: Any, center: Any, up: Any) -> None

X.lookAt(eye, center, up)

Supplemental documentation: Qt 5 reference:

void QMatrix4x4::lookAt(const QVector3D \&eye, const QVector3D \&center, const QVector3D \&up)

Multiplies this matrix by a viewing matrix derived from an eye point. The center value indicates the center of the view that the eye is looking at. The up value indicates which direction should be considered up with respect to the eye.

Note: The up vector must not be parallel to the line of sight from eye to center.

Upstream PySide2 reference signatures (binding differences may apply):

lookAt(self, eye: PySide2.QtGui.QVector3D, center: PySide2.QtGui.QVector3D, up: PySide2.QtGui.QVector3D) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#lookAt

map

map(point: Any) -> Any

X.map(point) -> PythonQt.QtCore.QPoint

Supplemental documentation: Qt 5 reference:

QPoint QMatrix4x4::map(const QPoint \&point) const

Maps point by multiplying this matrix by point.

See also mapRect().

QPointF QMatrix4x4::map(const QPointF \&point) const

Maps point by multiplying this matrix by point.

See also mapRect().

QVector3D QMatrix4x4::map(const QVector3D \&point) const

Maps point by multiplying this matrix by point.

See also mapRect() and mapVector().

QVector4D QMatrix4x4::map(const QVector4D \&point) const

Maps point by multiplying this matrix by point.

See also mapRect().

Upstream PySide2 reference signatures (binding differences may apply):

map(self, point: PySide2.QtCore.QPoint) -> PySide2.QtCore.QPoint
map(self, point: PySide2.QtCore.QPointF) -> PySide2.QtCore.QPointF
map(self, point: PySide2.QtGui.QVector3D) -> PySide2.QtGui.QVector3D
map(self, point: PySide2.QtGui.QVector4D) -> PySide2.QtGui.QVector4D

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#map

mapRect

mapRect(rect: Any) -> Any

X.mapRect(rect) -> PythonQt.QtCore.QRect

Supplemental documentation: Qt 5 reference:

QRect QMatrix4x4::mapRect(const QRect \&rect) const

Maps rect by multiplying this matrix by the corners of rect and then forming a new rectangle from the results. The returned rectangle will be an ordinary 2D rectangle with sides parallel to the horizontal and vertical axes.

See also map().

QRectF QMatrix4x4::mapRect(const QRectF \&rect) const

Maps rect by multiplying this matrix by the corners of rect and then forming a new rectangle from the results. The returned rectangle will be an ordinary 2D rectangle with sides parallel to the horizontal and vertical axes.

See also map().

Upstream PySide2 reference signatures (binding differences may apply):

mapRect(self, rect: PySide2.QtCore.QRect) -> PySide2.QtCore.QRect
mapRect(self, rect: PySide2.QtCore.QRectF) -> PySide2.QtCore.QRectF

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#mapRect

mapVector

mapVector(vector: Any) -> Any

X.mapVector(vector) -> PythonQt.QtGui.QVector3D

Supplemental documentation: Qt 5 reference:

QVector3D QMatrix4x4::mapVector(const QVector3D \&vector) const

Maps vector by multiplying the top 3x3 portion of this matrix by vector. The translation and projection components of this matrix are ignored.

See also map().

Upstream PySide2 reference signatures (binding differences may apply):

mapVector(self, vector: PySide2.QtGui.QVector3D) -> PySide2.QtGui.QVector3D

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#mapVector

operator_cast_

operator_cast_(row: Any, column: Any) -> float

X.operator_cast_(row, column) -> float

optimize

optimize() -> None

X.optimize()

Supplemental documentation: Qt 5 reference:

void QMatrix4x4::optimize()

Optimize the usage of this matrix from its current elements.

Some operations such as translate(), scale(), and rotate() can be performed more efficiently if the matrix being modified is already known to be the identity, a previous translate(), a previous scale(), etc.

Normally the QMatrix4x4 class keeps track of this special type internally as operations are performed. However, if the matrix is modified directly with operator()() or data(), then QMatrix4x4 will lose track of the special type and will revert to the safest but least efficient operations thereafter.

By calling optimize() after directly modifying the matrix, the programmer can force QMatrix4x4 to recover the special type if the elements appear to conform to one of the known optimized types.

See also operator()(), data(), and translate().

Upstream PySide2 reference signatures (binding differences may apply):

optimize(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#optimize

ortho

ortho(left: Any, right: Any, bottom: Any, top: Any, nearPlane: Any, farPlane: Any) -> None

X.ortho(left, right, bottom, top, nearPlane, farPlane)

Supplemental documentation: Qt 5 reference:

void QMatrix4x4::ortho(float left, float right, float bottom, float top, float nearPlane, float farPlane)

Multiplies this matrix by another that applies an orthographic projection for a window with lower-left corner (left, bottom), upper-right corner (right, top), and the specified nearPlane and farPlane clipping planes.

See also frustum() and perspective().

void QMatrix4x4::ortho(const QRect \&rect)

This is an overloaded function.

Multiplies this matrix by another that applies an orthographic projection for a window with boundaries specified by rect. The near and far clipping planes will be -1 and 1 respectively.

See also frustum() and perspective().

void QMatrix4x4::ortho(const QRectF \&rect)

This is an overloaded function.

Multiplies this matrix by another that applies an orthographic projection for a window with boundaries specified by rect. The near and far clipping planes will be -1 and 1 respectively.

See also frustum() and perspective().

Upstream PySide2 reference signatures (binding differences may apply):

ortho(self, left: float, right: float, bottom: float, top: float, nearPlane: float, farPlane: float) -> None
ortho(self, rect: PySide2.QtCore.QRect) -> None
ortho(self, rect: PySide2.QtCore.QRectF) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#ortho

perspective

perspective(verticalAngle: float, aspectRatio: float, nearPlane: float, farPlane: float) -> None

X.perspective(verticalAngle, aspectRatio, nearPlane, farPlane)

Supplemental documentation: Qt 5 reference:

void QMatrix4x4::perspective(float verticalAngle, float aspectRatio, float nearPlane, float farPlane)

Multiplies this matrix by another that applies a perspective projection. The vertical field of view will be verticalAngle degrees within a window with a given aspectRatio that determines the horizontal field of view. The projection will have the specified nearPlane and farPlane clipping planes which are the distances from the viewer to the corresponding planes.

See also ortho() and frustum().

Upstream PySide2 reference signatures (binding differences may apply):

perspective(self, verticalAngle: float, aspectRatio: float, nearPlane: float, farPlane: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#perspective

rotate

rotate(angle: Any, x: Any, y: Any, z: Any) -> None

X.rotate(angle, x, y, z)

Supplemental documentation: Qt 5 reference:

void QMatrix4x4::rotate(float angle, const QVector3D \&vector)

Multiples this matrix by another that rotates coordinates through angle degrees about vector.

See also scale() and translate().

void QMatrix4x4::rotate(float angle, float x, float y, float z \= 0.0f)

This is an overloaded function.

Multiplies this matrix by another that rotates coordinates through angle degrees about the vector (x, y, z).

See also scale() and translate().

void QMatrix4x4::rotate(const QQuaternion \&quaternion)

Multiples this matrix by another that rotates coordinates according to a specified quaternion. The quaternion is assumed to have been normalized.

See also scale(), translate(), and QQuaternion.

Upstream PySide2 reference signatures (binding differences may apply):

rotate(self, angle: float, vector: PySide2.QtGui.QVector3D) -> None
rotate(self, angle: float, x: float, y: float, z: float=...) -> None
rotate(self, quaternion: PySide2.QtGui.QQuaternion) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#rotate

row

row(index: int) -> Any

X.row(index) -> PythonQt.QtGui.QVector4D

Supplemental documentation: Qt 5 reference:

QVector4D QMatrix4x4::row(int index) const

Returns the elements of row index as a 4D vector.

See also setRow() and column().

Upstream PySide2 reference signatures (binding differences may apply):

row(self, index: int) -> PySide2.QtGui.QVector4D

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#row

scale

scale(x: Any, y: Any, z: Any) -> None

X.scale(x, y, z)

Supplemental documentation: Qt 5 reference:

void QMatrix4x4::scale(const QVector3D \&vector)

Multiplies this matrix by another that scales coordinates by the components of vector.

See also translate() and rotate().

void QMatrix4x4::scale(float x, float y)

This is an overloaded function.

Multiplies this matrix by another that scales coordinates by the components x, and y.

See also translate() and rotate().

void QMatrix4x4::scale(float x, float y, float z)

This is an overloaded function.

Multiplies this matrix by another that scales coordinates by the components x, y, and z.

See also translate() and rotate().

void QMatrix4x4::scale(float factor)

This is an overloaded function.

Multiplies this matrix by another that scales coordinates by the given factor.

See also translate() and rotate().

Upstream PySide2 reference signatures (binding differences may apply):

scale(self, factor: float) -> None
scale(self, vector: PySide2.QtGui.QVector3D) -> None
scale(self, x: float, y: float) -> None
scale(self, x: float, y: float, z: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#scale

setColumn

setColumn(index: int, value: Any) -> None

X.setColumn(index, value)

Supplemental documentation: Qt 5 reference:

void QMatrix4x4::setColumn(int index, const QVector4D \&value)

Sets the elements of column index to the components of value.

See also column() and setRow().

Upstream PySide2 reference signatures (binding differences may apply):

setColumn(self, index: int, value: PySide2.QtGui.QVector4D) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#setColumn

setRow

setRow(index: int, value: Any) -> None

X.setRow(index, value)

Supplemental documentation: Qt 5 reference:

void QMatrix4x4::setRow(int index, const QVector4D \&value)

Sets the elements of row index to the components of value.

See also row() and setColumn().

Upstream PySide2 reference signatures (binding differences may apply):

setRow(self, index: int, value: PySide2.QtGui.QVector4D) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#setRow

setToIdentity

setToIdentity() -> None

X.setToIdentity()

Supplemental documentation: Qt 5 reference:

void QMatrix4x4::setToIdentity()

Sets this matrix to the identity.

See also isIdentity().

Upstream PySide2 reference signatures (binding differences may apply):

setToIdentity(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#setToIdentity

toAffine

toAffine() -> Any

X.toAffine() -> PythonQt.QtGui.QMatrix

Upstream PySide2 reference signatures (binding differences may apply):

toAffine(self) -> PySide2.QtGui.QMatrix

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#toAffine

toTransform

toTransform(distanceToPlane: Any) -> Any

X.toTransform(distanceToPlane) -> PythonQt.QtGui.QTransform

Supplemental documentation: Qt 5 reference:

QTransform QMatrix4x4::toTransform() const

Returns the conventional Qt 2D transformation matrix that corresponds to this matrix.

The returned QTransform is formed by simply dropping the third row and third column of the QMatrix4x4. This is suitable for implementing orthographic projections where the z co-ordinate should be dropped rather than projected.

See also toAffine().

QTransform QMatrix4x4::toTransform(float distanceToPlane) const

Returns the conventional Qt 2D transformation matrix that corresponds to this matrix.

If distanceToPlane is non-zero, it indicates a projection factor to use to adjust for the z co-ordinate. The value of 1024 corresponds to the projection factor used by QTransform::rotate() for the x and y axes.

If distanceToPlane is zero, then the returned QTransform is formed by simply dropping the third row and third column of the QMatrix4x4. This is suitable for implementing orthographic projections where the z co-ordinate should be dropped rather than projected.

See also toAffine().

Upstream PySide2 reference signatures (binding differences may apply):

toTransform(self) -> PySide2.QtGui.QTransform
toTransform(self, distanceToPlane: float) -> PySide2.QtGui.QTransform

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#toTransform

translate

translate(x: Any, y: Any, z: Any) -> None

X.translate(x, y, z)

Supplemental documentation: Qt 5 reference:

void QMatrix4x4::translate(const QVector3D \&vector)

Multiplies this matrix by another that translates coordinates by the components of vector.

See also scale() and rotate().

void QMatrix4x4::translate(float x, float y)

This is an overloaded function.

Multiplies this matrix by another that translates coordinates by the components x, and y.

See also scale() and rotate().

void QMatrix4x4::translate(float x, float y, float z)

This is an overloaded function.

Multiplies this matrix by another that translates coordinates by the components x, y, and z.

See also scale() and rotate().

Upstream PySide2 reference signatures (binding differences may apply):

translate(self, vector: PySide2.QtGui.QVector3D) -> None
translate(self, x: float, y: float) -> None
translate(self, x: float, y: float, z: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#translate

transposed

transposed() -> Any

X.transposed() -> PythonQt.QtGui.QMatrix4x4

Supplemental documentation: Qt 5 reference:

QMatrix4x4 QMatrix4x4::transposed() const

Returns this matrix, transposed about its diagonal.

Upstream PySide2 reference signatures (binding differences may apply):

transposed(self) -> PySide2.QtGui.QMatrix4x4

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#transposed

viewport

viewport(left: Any, bottom: Any, width: Any, height: Any, nearPlane: Any, farPlane: Any) -> None

X.viewport(left, bottom, width, height, nearPlane, farPlane)

Supplemental documentation: Qt 5 reference:

void QMatrix4x4::viewport(float left, float bottom, float width, float height, float nearPlane \= 0.0f, float farPlane \= 1.0f)

Multiplies this matrix by another that performs the scale and bias transformation used by OpenGL to transform from normalized device coordinates (NDC) to viewport (window) coordinates. That is it maps points from the cube ranging over [-1, 1] in each dimension to the viewport with it's near-lower-left corner at (left, bottom, nearPlane) and with size (width, height, farPlane - nearPlane).

This matches the transform used by the fixed function OpenGL viewport transform controlled by the functions glViewport() and glDepthRange().

void QMatrix4x4::viewport(const QRectF \&rect)

This is an overloaded function.

Sets up viewport transform for viewport bounded by rect and with near and far set to 0 and 1 respectively.

Upstream PySide2 reference signatures (binding differences may apply):

viewport(self, left: float, bottom: float, width: float, height: float, nearPlane: float=..., farPlane: float=...) -> None
viewport(self, rect: PySide2.QtCore.QRectF) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmatrix4x4.html#viewport