OpenGL 加速係列範例

範例展示如何啓用 OpenGL 加速為 QLineSeries and QScatterSeries .

運行範例

要運行範例從 Qt Creator ,打開 歡迎 模式,然後選擇範例從 範例 。更多信息,見 Qt Creator:教程:構建並運行 .

啓用 OpenGL 加速

為創建 OpenGL 加速係列,相比常規係列要做的是設置 QAbstractSeries::useOpenGL 特性到 true :

series->setUseOpenGL(true);
						

This makes the chart to instantiate a transparent QOpenGLWidget that is used to draw the accelerated series on top of the chart.

注意: OpenGL 加速僅支持 QLineSeries and QScatterSeries .

範例工程 @ code.qt.io