Obsolete Members for QtGraphs3D

QtGraphs3D 类的以下成员已被废弃。提供这些成员是为了确保旧源代码能够继续运行。我们强烈建议不要在新代码中使用它们。

函数

(deprecated in 6.9) QSurfaceFormat qDefaultSurfaceFormat(bool antialias)

函数文档

[deprecated in 6.9] QSurfaceFormat qDefaultSurfaceFormat(bool antialias)

自 6.9 版本起,此函数已被废弃。我们强烈建议不要在新代码中使用它。

请使用QQuick3D::idealSurfaceFormat()

此便捷函数可用于创建适合Qt Graphs 图形使用的自定义表面格式。

antialias 参数用于指定是否启用抗锯齿。

在调用show() 之前,请将该函数返回的表面格式传递给图形构造函数(C++),或将其设置为QQuickView 的窗口格式(QML)。

例如,在 C++ 应用程序中禁用抗锯齿:

#include <QtGraphs/qutils.h>

// ...

QSurfaceFormat::setDefaultFormat(qDefaultSurfaceFormat(true));

例如,在 QML 应用程序中为直接渲染模式启用抗锯齿:

#include <QtGraphs/qutils.h>

// ...

QQuickView viewer;
viewer.setFormat(qDefaultSurfaceFormat(true));

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