<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/canvas2d-new-qml-canvas-element-using-qt-canvas-painter-shbrjjkzc" -->

---
title: Canvas2D: New QML canvas element using Qt Canvas Painter
description: Qt 6.12 introduces Canvas2D, a new QML canvas element built on Qt Canvas Painter that renders on the GPU via QRhi instead of using QPainter on the CPU. It...
canonical: https://daily.dev/posts/canvas2d-new-qml-canvas-element-using-qt-canvas-painter-shbrjjkzc
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Canvas2D: New QML canvas element using Qt Canvas Painter | daily.dev
og:description: Qt 6.12 introduces Canvas2D, a new QML canvas element built on Qt Canvas Painter that renders on the GPU via QRhi instead of using QPainter on the CPU. It...
og:url: https://daily.dev/posts/canvas2d-new-qml-canvas-element-using-qt-canvas-painter-shbrjjkzc
og:image: https://api.daily.dev/og/posts/ShbrJjKzC.png
og:image:alt: Canvas2D: New QML canvas element using Qt Canvas Painter
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Canvas2D: New QML canvas element using Qt Canvas Painter

**[Qt](https://daily.dev/sources/qt)** · 11 min read · 0 upvotes · 0 comments

## Summary

Qt 6.12 introduces Canvas2D, a new QML canvas element built on Qt Canvas Painter that renders on the GPU via QRhi instead of using QPainter on the CPU. It implements the W3C Canvas 2D Context API (beginPath, fillStyle, bezierCurveTo, etc.) so existing HTML canvas code often runs unchanged, while adding extras like Path2D with path groups, adjustable antialiasing, box gradients and shadows, grid patterns, color effects, and a Transform2D matrix object. Some HTML canvas features are missing, including path-based clipping, dashed strokes, path hit-testing, text stroking, filters, and most composite modes. Migrating from Qt Quick Canvas typically requires only renaming Canvas to Canvas2D. Benchmarks with QCPainterBench show Canvas2D running over 40 times faster than the old Canvas (165 FPS vs 4 FPS) on identical JavaScript painting code. Canvas2D ships as a technology preview in Qt 6.12, so its API may still change before stabilizing.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.qt.io/blog/canvas2d-new-qml-canvas-element-using-qt-canvas-painter>

## Questions this post answers

### What is the new Canvas2D element in Qt 6.12 and how is it different from Qt Quick Canvas?

Canvas2D is a new QML item introduced in Qt 6.12 that paints using Qt Canvas Painter, rendering directly on the GPU via QRhi instead of Qt Quick Canvas's CPU-based QPainter-into-QImage approach. Migration typically only requires renaming Canvas to Canvas2D and adding the QtCanvas2D import, since the JavaScript drawing API is nearly identical. It is shipped as a technology preview, so its API may still change.

_Developers evaluating Qt Quick Canvas migrations can track Canvas2D's API evolution on daily.dev._

### How much faster is Canvas2D than Qt Quick Canvas for animated content?

Canvas2D is over 40 times faster than Qt Quick Canvas for animated painting, according to QCPainterBench results showing 165 FPS versus 4 FPS with identical JavaScript painting code running 16 tests. The performance gap comes solely from Canvas2D's GPU-based rendering via QRhi being better optimized for continuously repainted, animated canvases than the CPU-based Quick Canvas backend.

_Teams weighing rendering backends for animated QML visualizations can follow benchmark comparisons like this on daily.dev._

### Which HTML Canvas features are missing from Qt's new Canvas2D API?

Canvas2D lacks path-based clipping (only rectangle clipping via setClipRect), dashed strokes, path hit-testing (isPointInPath/isPointInStroke), text stroking, SVG filter effects, most composite modes (only source-over, source-atop, and destination-out are supported), and pixel operations like getImageData/putImageData. In exchange it adds features HTML Canvas lacks, such as Path2D path groups, box gradients, box shadows, and adjustable antialiasing.

_Developers porting canvas code should check daily.dev for API compatibility gaps before migrating._

## Similar posts on daily.dev

- [2D Rendering - Introducing Qt Canvas Painter](https://daily.dev/posts/2d-rendering---introducing-qt-canvas-painter-huyota205) · Qt · 0 upvotes · 0 comments
- [New Canvas Rendering Features in Qt](https://daily.dev/posts/new-canvas-rendering-features-in-qt-goonbhtrf) · Qt · 3 upvotes · 0 comments
- [Qt Canvas Painter: Accelerated performance using paths](https://daily.dev/posts/qt-canvas-painter-accelerated-performance-using-paths-ey0vr993g) · Qt · 1 upvotes · 0 comments
- [Introducing the Canvas2D Coding Skill for Agentic Development of Embedded Device UIs](https://daily.dev/posts/introducing-the-canvas2d-coding-skill-for-agentic-development-of-embedded-device-uis-v80f8g4cu) · Qt · 2 upvotes · 0 comments

---

Tags: [#qt](https://daily.dev/tags/qt), [#qml](https://daily.dev/tags/qml)

[View this post on daily.dev](https://daily.dev/posts/canvas2d-new-qml-canvas-element-using-qt-canvas-painter-shbrjjkzc)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Canvas2D: New QML canvas element using Qt Canvas Painter","url":"https://daily.dev/posts/canvas2d-new-qml-canvas-element-using-qt-canvas-painter-shbrjjkzc","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/canvas2d-new-qml-canvas-element-using-qt-canvas-painter-shbrjjkzc"},"datePublished":"2026-09-18T08:17:54.912Z","dateModified":"2026-09-18T08:47:39.728Z","description":"Qt 6.12 introduces Canvas2D, a new QML canvas element built on Qt Canvas Painter that renders on the GPU via QRhi instead of using QPainter on the CPU. It...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c94cfb06ee8d793c202694b0266cabef?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c94cfb06ee8d793c202694b0266cabef?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Qt","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Qt","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/fe6d7c1f4f824966befd58ee13f9de40","url":"https://daily.dev/sources/qt"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/canvas2d-new-qml-canvas-element-using-qt-canvas-painter-shbrjjkzc","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"qt,qml","timeRequired":"PT11M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Qt","item":"https://daily.dev/sources/qt"},{"@type":"ListItem","position":3,"name":"Canvas2D: New QML canvas element using Qt Canvas Painter"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/canvas2d-new-qml-canvas-element-using-qt-canvas-painter-shbrjjkzc#faq","mainEntity":[{"@type":"Question","name":"What is the new Canvas2D element in Qt 6.12 and how is it different from Qt Quick Canvas?","acceptedAnswer":{"@type":"Answer","text":"Canvas2D is a new QML item introduced in Qt 6.12 that paints using Qt Canvas Painter, rendering directly on the GPU via QRhi instead of Qt Quick Canvas's CPU-based QPainter-into-QImage approach. Migration typically only requires renaming Canvas to Canvas2D and adding the QtCanvas2D import, since the JavaScript drawing API is nearly identical. It is shipped as a technology preview, so its API may still change. Developers evaluating Qt Quick Canvas migrations can track Canvas2D's API evolution on daily.dev."}},{"@type":"Question","name":"How much faster is Canvas2D than Qt Quick Canvas for animated content?","acceptedAnswer":{"@type":"Answer","text":"Canvas2D is over 40 times faster than Qt Quick Canvas for animated painting, according to QCPainterBench results showing 165 FPS versus 4 FPS with identical JavaScript painting code running 16 tests. The performance gap comes solely from Canvas2D's GPU-based rendering via QRhi being better optimized for continuously repainted, animated canvases than the CPU-based Quick Canvas backend. Teams weighing rendering backends for animated QML visualizations can follow benchmark comparisons like this on daily.dev."}},{"@type":"Question","name":"Which HTML Canvas features are missing from Qt's new Canvas2D API?","acceptedAnswer":{"@type":"Answer","text":"Canvas2D lacks path-based clipping (only rectangle clipping via setClipRect), dashed strokes, path hit-testing (isPointInPath/isPointInStroke), text stroking, SVG filter effects, most composite modes (only source-over, source-atop, and destination-out are supported), and pixel operations like getImageData/putImageData. In exchange it adds features HTML Canvas lacks, such as Path2D path groups, box gradients, box shadows, and adjustable antialiasing. Developers porting canvas code should check daily.dev for API compatibility gaps before migrating."}}]}
```

