DebugView QML Type
用于显示渲染统计信息并执行调试和开发操作的视图。更多...
| Import Statement: | import QtQuick3D.Helpers |
| Inherits: |
属性
- resourceDetailsVisible : bool
- source : var
详细说明
此辅助控件可用于查看View3D 的渲染性能统计信息。它会显示帧率(FPS)、同步时间和渲染时间。此外,它还可以显示有关绘制调用、渲染通道以及场景资产所使用的纹理和网格的详细统计信息。此类扩展信息的显示由resourceDetailsVisible 属性控制,该属性的默认值为false。
例如,以下代码片段演示了如何添加一个 DebugView,将其信息显示在Qt Quick 场景的左上角:
View3D {
id: v3d
anchors.fill: parent
camera: camera
PerspectiveCamera {
id: camera
position: Qt.vector3d(0, 0, 600)
}
...
}
DebugView {
source: v3d
resourceDetailsVisible: true
}此外,Tools 部分还允许执行诸如开启线框渲染,或可视化材质各属性等操作。
属性文档
resourceDetailsVisible : bool [default: false]
用于指定是否默认显示包含详细渲染通道、网格、纹理及其他资源统计信息的附加字段。
默认值为 false,这意味着仅会显示上一帧渲染的 CPU 计时数据,除非用户通过屏幕上的复选框手动启用额外数据。将该值改为 true 可在默认情况下显示更多信息,其中包括渲染通道详细信息以及上一帧渲染中处于活动状态的资源。
source : var
指定要显示其统计信息的源View3D 。
© 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.