PlanarTransform QML Type | Qt Quick 6.8.3 (original) (raw)

Provides utility functions for matrix4x4 when used for 2D transforms. More...

Import Statement: import QtQuick
Since: Qt 6.8

Methods

Detailed Description

The PlanarTransform is a global object with utility functions.

It is not instantiable; to use it, call the members of the global PlanarTransform object directly. For example:

Item { transform: Matrix4x4 { matrix: PlanarTransform.fromAffineMatrix(1, 0, 0.36, 1, -36, 0) } }

Method Documentation

Returns a matrix4x4 for an affine (non-projecting) 2D transform with the specified values.

This method and its argument order correspond to SVG's matrix() function and the six-argument QTransform constructor. The result is this 4x4 matrix:

scaleX shearX 0 translateX
shearY scaleY 0 translateY
0 0 1 0
0 0 0 1

Returns a matrix4x4 for a 2D transform that rotates by angle degrees around the point (originX, originY).

originX and originY are optional and default to (0, 0).

Returns a matrix4x4 for a 2D transform that scales by scaleX horizontally and scaleY vertically, centered at the point (originX, originY).

originX and originY are optional and default to (0, 0).

matrix4x4 fromShear(float shearX, float shearY, float originX, float originY)

Returns a matrix4x4 for a 2D transform that shears by shearX horizontally and shearY vertically, centered at the point (originX, originY).

originX and originY are optional and default to (0, 0).

Returns a matrix4x4 for a 2D transform that translates by translateX horizontally and translateY vertically.

Returns a matrix4x4 for the identity transform.

This is equivalent to Qt::matrix4x4().

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.