本页内容

QSGDynamicTexture Class

QSGDynamicTexture 类是用于动态更改纹理(例如渲染到 FBO 中的内容)的基类。更多内容...

头文件: #include <QSGDynamicTexture>
CMake: find_package(Qt6 REQUIRED COMPONENTS Quick)
target_link_libraries(mytarget PRIVATE Qt6::Quick)
qmake: QT += quick
继承自: QSGTexture

公共函数

QSGDynamicTexture()
virtual bool updateTexture() = 0

详细说明

要更新纹理的内容,请显式调用updateTexture()。

注意:所有 前缀为 QSG 的类应仅在场景图的渲染线程上使用。有关更多信息,请参阅“场景图与渲染”。

成员函数文档

[noexcept default] QSGDynamicTexture::QSGDynamicTexture()

默认——构造一个QSGDynamicTexture 实例。

[pure virtual] bool QSGDynamicTexture::updateTexture()

调用此函数以显式更新动态纹理。

如果更新导致纹理发生变化,该函数返回 true;否则返回 false。

注意:该 函数通常由QQuickItem::updatePaintNode()或QSGNode::preprocess()调用,即在场景图的synchronization 或node preprocessing 阶段。不建议在其他时间调用该函数,否则可能会导致意外行为。

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