OpenGL 加速系列示例
该示例显示了如何为QLineSeries 和QScatterSeries 启用 OpenGL 加速。
运行示例
要运行来自 Qt Creator,打开Welcome 模式,然后从Examples 中选择示例。有关详细信息,请参阅Qt Creator: 教程:构建并运行。
启用 OpenGL 加速
要创建 OpenGL 加速序列,与普通序列相比,只需将QAbstractSeries::useOpenGL 属性设置为true
即可:
series->setUseOpenGL(true);
这将使图表实例化一个透明的 QOpenGLWidget,用于在图表顶部绘制加速序列。
注意: OpenGL 加速仅支持QLineSeries 和QScatterSeries 。
© 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.