QSGTransformNode Class

QSGTransformNode 类实现了场景图中的变换。更多

Header: #include <QSGTransformNode>
CMake: find_package(Qt6 REQUIRED COMPONENTS Quick)
target_link_libraries(mytarget PRIVATE Qt6::Quick)
qmake: QT += quick
继承: QSGNode
继承于:

QSGTextNode

公共函数

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

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