Nesta página

PlanarTransform QML Type

Fornece funções utilitárias para matrizes 4x4 quando utilizadas em transformações 2D. Mais...

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()

Descrição detalhada

O ` PlanarTransform ` é um objeto global com funções utilitárias.

Ele não é instanciável; para usá-lo, chame diretamente os membros do objeto global ` PlanarTransform `. Por exemplo:

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

Documentação dos métodos

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

Retorna uma matriz 4x4 para uma transformação 2D afim (não projetante) com os valores especificados.

Este método e a ordem de seus argumentos correspondem à função ` matrix() ` do SVG e ao construtor de seis argumentos ` QTransform `. O resultado é esta matriz 4x4:

scaleXshearX0translateX
shearYscaleY0translateY
0010
0001

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

Retorna uma matriz 4x4 para uma transformação 2D que gira em angle graus em torno do ponto (originX, originY).

originX e originY são opcionais e têm como valor padrão (0, 0).

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

Retorna uma matriz 4x4 para uma transformação 2D que escala horizontalmente por scaleX e verticalmente por scaleY, centralizada no ponto (originX, originY).

originX e originY são opcionais e têm como valor padrão (0, 0).

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

Retorna uma matriz 4x4 para uma transformação 2D que aplica um deslocamento horizontal de shearX e um deslocamento vertical de shearY, centralizada no ponto (originX, originY).

originX e ` originY ` são opcionais e têm como valor padrão (0, 0).

matrix4x4 fromTranslate(real translateX, real translateY)

Retorna uma matriz 4x4 correspondente a uma transformação 2D que realiza uma translação de translateX na direção horizontal e de translateY na direção vertical.

matrix4x4 identity()

Retorna uma matriz 4x4 para a transformação identitária.

Isso equivale 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.