QMatrix4x4 matrix; matrix.rotate(90, QVector3D(0, 0, 1));
QMatrix4x4 matrix; matrix.rotate(angle, QVector3D(x, y, z));In this example, we rotate a matrix by a certain angle around an arbitrary axis by passing the angle in degrees and the vector for the axis of rotation (x, y, z) to the rotate method. Package library: Qt 5 (QtCore module)