En esta página

PlanarTransform QML Type

Proporciona funciones de utilidad para matrix4x4 cuando se utiliza para transformaciones 2D. Más...

Import Statement: import QtQuick
Since: Qt 6.8

Métodos

  • matrix4x4 fromAffineMatrix(real scaleX, real shearY, real shearX, real scaleY, real translateX, real translateY)
  • matrix4x4 fromRotate(real angle, real originX, real originY)
  • matrix4x4 fromScale(real scaleX, real scaleY, real originX, real originY)
  • matrix4x4 fromShear(float shearX, float shearY, float originX, float originY)
  • matrix4x4 fromTranslate(real translateX, real translateY)
  • matrix4x4 identity()

Descripción detallada

PlanarTransform es un objeto global con funciones de utilidad.

No es instanciable; para utilizarlo, llame directamente a los miembros del objeto global PlanarTransform. Por ejemplo

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

Método Documentación

matrix4x4 fromAffineMatrix(real scaleX, real shearY, real shearX, real scaleY, real translateX, real translateY)

Devuelve una matriz4x4 para una transformación 2D afín (no proyectiva) con los valores especificados.

Este método y el orden de sus argumentos corresponden a la función matrix() de SVG y al constructor de seis argumentos QTransform. El resultado es esta matriz 4x4:

scaleXshearX0translateX
shearYscaleY0translateY
0010
0001

matrix4x4 fromRotate(real angle, real originX, real originY)

Devuelve una matriz4x4 para una transformación 2D que rota angle grados alrededor del punto (originX, originY).

originX y originY son opcionales y por defecto son (0, 0).

matrix4x4 fromScale(real scaleX, real scaleY, real originX, real originY)

Devuelve una matriz4x4 para una transformación 2D que escala en scaleX horizontalmente y scaleY verticalmente, centrada en el punto (originX, originY).

originX y originY son opcionales y por defecto son (0, 0).

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

Devuelve una matriz4x4 para una transformación 2D que cizalla por shearX horizontalmente y shearY verticalmente, centrada en el punto (originX, originY).

originX y originY son opcionales y por defecto son (0, 0).

matrix4x4 fromTranslate(real translateX, real translateY)

Devuelve una matriz4x4 para una transformación 2D que se traduce por translateX horizontalmente y translateY verticalmente.

matrix4x4 identity()

Devuelve una matriz4x4 para la transformada de identidad.

Esto es equivalente a Qt::matrix4x4().

© 2026 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.