Matrix4x4 QML Type
提供了一种将 4x4 变换矩阵应用于Item 的方法。更多内容...
| Import Statement: | import QtQuick |
属性
- matrix : matrix4x4
详细说明
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
一个4×4矩阵,将用于对一个Item
© 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.