Qt3D 的变化
Qt 6 是有意识地使框架更高效、更易用的结果。
我们尝试在每个版本中保持所有公共 API 的二进制和源代码兼容性。但为了使 Qt 成为一个更好的框架,有些改动是不可避免的。
在本专题中,我们总结了 Qt3D 中的这些变化,并提供了处理这些变化的指南。
新的渲染后端
在 5.14 和 5.15 中,渲染后端被逐步移到一个插件中。
Qt 6 版本完成了这项工作,并引入了新的基于 RHI 的渲染后端,可在相关平台上使用 Vulkan、Metal 或 DirectX。
RHI 后端是默认的,但可以通过设置环境变量来控制,详见here 。
代码变更
一些类的模块发生了变化。尤其是QBuffer 、QAttribute 和 QGeometry 类(以及相关辅助类)已从渲染模块移至核心模块。
新的应用程序接口
- Qt3DCore::QGeometryView 提供网格的所有细节
- Qt3DCore::QBoundingVolume 提供了一种查询或覆盖几何体轴对齐包围盒大小的方法
- Qt3DRender::QPickingProxy 提供了一种指定替代(通常更简单)几何体的方法,以进行拾取
- Qt3DCore::QAbstractAspect 和 添加方法,以促进和优化后台操作的同步。Qt3DCore::QAspectJob
© 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.