QSGTransformNode Class
QSGTransformNode 类在场景图中实现了变换。更多内容...
| 头文件: | #include <QSGTransformNode> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Quick) target_link_libraries(mytarget PRIVATE Qt6::Quick) |
| qmake: | QT += quick |
| 继承自: | QSGNode |
| 被继承者: |
- 所有成员列表(包括继承的成员)
- QSGTransformNode 是Qt Quick 场景图节点类的一部分。
公共函数
| QSGTransformNode() | |
| virtual | ~QSGTransformNode() override |
| const QMatrix4x4 & | matrix() const |
| void | setMatrix(const QMatrix4x4 &matrix) |
详细说明
变换会作用于节点的子树,并且可以嵌套。多个变换节点的矩阵将通过交集运算进行累加。该累加过程作为渲染的一部分进行。
变换节点实现了一个 4x4 矩阵,理论上支持完整的 3D 变换。但是,由于渲染器针对 2D 用例而非 3D 用例进行了优化,因此渲染包含完整 3D 变换的场景时需要格外谨慎。
注意:所有 以 QSG 为前缀的类应仅在场景图的渲染线程上使用。更多信息请参阅《场景图与渲染》。
成员函数文档
QSGTransformNode::QSGTransformNode()
创建一个新的 QSGTransformNode,并将它的矩阵设置为单位矩阵。
[override virtual noexcept] QSGTransformNode::~QSGTransformNode()
删除此变换节点。
const QMatrix4x4 &QSGTransformNode::matrix() const
返回此变换节点的矩阵。
另请参阅 ` setMatrix()`。
void QSGTransformNode::setMatrix(const QMatrix4x4 &matrix)
将此变换节点的矩阵设置为matrix 。
另请参阅 matrix()。
© 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.