DebugView QML Type

视图,用于显示渲染统计信息并执行调试和开发人员操作。更多

Import Statement: import QtQuick3D.Helpers
Inherits:

Rectangle

属性

详细说明

该辅助工具允许查看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


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