- Qt 5.15
- Qt GUI
- C++ Classes
- QMatrix4x4
- Qt 5.15.15 Reference Documentation

# Obsolete Members for QMatrix4x4

The following members of class QMatrix4x4 are obsolete. They are provided to keep old source code working. We strongly advise against using them in new code.

## Public Functions

`(obsolete)` | QMatrix4x4(const QMatrix &matrix)
`(obsolete)` void | flipCoordinates()
`(obsolete)` QMatrix | toAffine() const

## Related Non-Members

`(obsolete)` QGenericMatrix<N, M, float> | qGenericMatrixFromMatrix4x4(const QMatrix4x4 &matrix)
`(obsolete)` QMatrix4x4 | qGenericMatrixToMatrix4x4(const QGenericMatrix<N, M, float> &matrix = N)

## Member Function Documentation

### QMatrix4x4::QMatrix4x4(const QMatrix &matrix)

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Constructs a 4x4 matrix from a conventional Qt 2D affine transformation matrix.

If matrix has a special type (identity, translate, scale, etc), the programmer should follow this constructor with a call to optimize() if they wish QMatrix4x4 to optimize further calls to translate(), scale(), etc.

See also toAffine() and optimize().

### void QMatrix4x4::flipCoordinates()

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Flips between right-handed and left-handed coordinate systems by multiplying the y and z co-ordinates by -1. This is normally used to create a left-handed orthographic view without scaling the viewport as ortho() does.

See also ortho().

### QMatrix QMatrix4x4::toAffine() const

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Use toTransform() instead.

Returns the conventional Qt 2D affine transformation matrix that corresponds to this matrix. It is assumed that this matrix only contains 2D affine transformation elements.

See also toTransform().

## Related Non-Members

### template <int N, int M> QGenericMatrix<N, M, float> qGenericMatrixFromMatrix4x4(const QMatrix4x4 &matrix)

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Returns a NxM generic matrix constructed from the left-most N columns and top-most M rows of matrix. If N or M is greater than 4, then the remaining elements are filled with elements from the identity matrix.

See also QMatrix4x4::toGenericMatrix().

### template <int N, int M> QMatrix4x4 qGenericMatrixToMatrix4x4(const QGenericMatrix<N, M, float> &matrix = N)

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Returns a 4x4 matrix constructed from the left-most 4 columns and top-most 4 rows of matrix. If matrix has less than 4 columns or rows, the remaining elements are filled with elements from the identity matrix.