Qt Canvas Painter
The Qt Canvas Painter module provides classes for hardware-accelerated imperative 2D painting. This painting API is available for both Qt Quick and Qt Widgets, and can also be used directly with QRhi. The API design generally follows HTML canvas 2d context, with some reductions and some additions.
Compared to QPainter, the Qt Canvas Painter is more compact and has fewer abstractions, aiming to perform optimally on QRhi. Qt Canvas Painter is designed for GPU rendering and does not have a CPU backend as QPainter does.
Note: The Qt Canvas Painter module is currently in tech preview.
Using the Module
C++ API
Using a Qt module's C++ API requires linking against the module library, either directly or through other dependencies. Several build tools have dedicated support for this, including CMake and qmake.
Building with CMake
Use the find_package() command to locate the needed module component in the Qt6 package:
find_package(Qt6 REQUIRED COMPONENTS CanvasPainter)
target_link_libraries(mytarget PRIVATE Qt6::CanvasPainter)For more details, see the Build with CMake overview.
Class Reference
Examples
Licenses and Attributions
Qt Canvas Painter runtime library is available under commercial licenses from The Qt Company. In addition, it is available under the GNU General Public License, version 3.
See Qt Licensing for further details.
Furthermore, Qt Canvas Painter in 6.11.0 may contain third party modules under following permissive licenses:
zlib License |
© 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.