Qt Graphs 2D Rendering Backends
Qt Graphs for 2D can draw a GraphsView with either of two rendering backends:
- The high-quality backend, which draws with Qt Quick Shapes. This is the default.
- The high-performance backend, which draws with Qt Canvas Painter. This backend is available only if you enable it when you build the Qt Graphs module.
Both backends produce the same graphs from the same API. They differ only in how they draw them.
Note: The build determines which backends are available. Each graph then picks one of them at run time.
High-Quality Backend
The high-quality backend draws each series with Qt Quick Shapes, using Shape.CurveRenderer, which keeps strokes and curved edges smooth at any scale. The shapes become part of the scene graph, so the graph is rendered without an intermediate render target.
High-Performance Backend
The high-performance backend draws the whole graph with Qt Canvas Painter. All of the 2D renderers paint into a single QCanvasPainterItem, a QQuickRhiItem that renders into an offscreen color buffer sized to the item, so the graph is one scene graph item no matter how many series it contains, and it is resampled rather than redrawn if the item is scaled by a transformation.
Choosing a Backend
The high-quality backend is the default, and is the right choice unless there is a specific reason to change.
Neither backend redraws a graph that does not change, so for a graph that is drawn once and then left alone, the choice only affects visual quality. The difference in rendering cost shows up when the data, the axis ranges, or the size of the graph keep changing, because that is when the high-quality backend has to rebuild its shape geometry.
The choice does not affect ScatterSeries. Neither backend draws its points. They are Qt Quick items, created from the component set as pointDelegate, or from a built-in marker when the series sets none. The other XY series draw their points the same way when they set a delegate. Their lines and areas still go through the backend.
Consider the high-performance backend when:
- The graph contains a large number of series, or series with a large number of points.
- The data is updated continuously, for example from a live sensor feed, so the shape geometry would have to be rebuilt on every frame.
- The application runs on hardware where the number of scene graph nodes and draw calls is the limiting factor.
Stay with the high-quality backend when:
- The graph is scaled, rotated, or otherwise transformed by its parent items, or is rendered into a layer that is scaled.
- Visual fidelity of strokes and curves matters more than the cost of drawing them.
- You don't want to add a dependency on the Qt Canvas Painter module.
Building with a Backend
The following table describes the two configure features that control the backends.
| Feature | Default | Requires |
|---|---|---|
graphs-2d-high-quality-backend | ON | Nothing beyond the normal Qt Graphs dependencies. |
graphs-2d-high-performance-backend | OFF | The Qt Canvas Painter module (qtcanvaspainter). |
You can enable the high-performance backend only if Qt Canvas Painter is available. If you request the feature in a build without that module, configure fails with an error.
To enable the high-performance backend when configuring Qt:
./configure -feature-graphs-2d-high-performance-backendTo do the same with CMake:
cmake -DFEATURE_graphs_2d_high_performance_backend=ON <source>To disable the high-quality backend, pass -no-feature-graphs-2d-high-quality-backend to configure, or -DFEATURE_graphs_2d_high_quality_backend=OFF to CMake.
The Qt Graphs 2D section of the configure summary lists the resulting state as High Quality and High Performance.
The two features are independent, and you can enable both. A graph then chooses between them at run time.
Axes, grids, BarSeries, ScatterSeries, and the delegates of CustomSeries do not go through either backend, so Qt Graphs draws them even in a build that has neither. AreaSeries, LineSeries, PieSeries, and SplineSeries do need one, and configuring a build that has those graph types but no backend fails with an error. To build the backend-less variant, disable those graph types as well:
./configure -no-feature-graphs-2d-high-quality-backend \
-no-feature-graphs-2d-area \
-no-feature-graphs-2d-donut-pie \
-no-feature-graphs-2d-line \
-no-feature-graphs-2d-splineQt Graphs Configure Options describes how to enable only the graph types that you need.
Selecting the Backend at Run Time
The high-performance backend is off by default. Unless Qt Graphs was built with it enabled, there is nothing to select between, and the graph is always drawn with Qt Quick Shapes.
In a build that has both backends, each GraphsView selects its backend with the GraphsView::useCanvasPainter property:
GraphsView {
anchors.fill: parent
// Draw this graph with the high-performance backend.
useCanvasPainter: true
LineSeries {
XYPoint { x: 0; y: 0 }
XYPoint { x: 1; y: 1 }
}
}The property defaults to false when the high-quality backend is available, and to true when the build has only the high-performance backend. In a build without the high-performance backend, setting the property to true has no effect and produces no warning.
Extending the Backends
A CustomSeries draws itself with its delegate component, which works regardless of which backend draws the rest of the graph.
A custom series can also paint with QCanvasPainter, by passing a QCustomSeriesCanvasRenderer subclass to QCustomSeries::setCustomSeriesPainter(). That method only exists in a build that has the high-performance backend, and the painter is only used while that backend is drawing the graph.
See also Qt Graphs Configure Options, Qt Graphs Overview for 2D, GraphsView, and Qt Canvas Painter.
© 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.