Matrix4x4 QML Type

提供一种将 4x4 变换矩阵应用于Item 的方法 ... 更多...

Import Statement: import QtQuick

属性

详细说明

Matrix4x4 类型提供了一种通过 4x4 矩阵对Item 应用变换的方法。

只需使用一个 4x4 矩阵中提供的变换,就能将旋转、缩放、平移和剪切结合起来。

下面的示例将矩形旋转 45 度(PI/4):

Rectangle {
    width: 100
    height: 100
    color: "red"

    transform: Matrix4x4 {
        property real a: Math.PI / 4
        matrix: Qt.matrix4x4(Math.cos(a), -Math.sin(a), 0, 0,
                             Math.sin(a),  Math.cos(a), 0, 0,
                             0,           0,            1, 0,
                             0,           0,            0, 1)
    }
}

属性文档

matrix : matrix4x4

4x4 矩阵,该矩阵将用于一个Item


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