[Interest] QQuickPaintedItem vs QML Canvas

Philip Schuchardt vpicaver at gmail.com
Tue Nov 29 16:54:39 CET 2016


I would recommend using QQuickPaintedItem. It'll probably take you less
time to port your code. I've found QML canvas a bit hard to debug since
it's all in javascript. It's really easy to miss spell an object's variable
name and rendering won't work. I've also found it to be more buggy than a
QQuickPaintedItem, although that was several years ago.  Also, with QML
canvas you loose the ability to print, convert it to a PDF, or
high-resolution image.

In terms of performance, QQuickPainterItem will block both the rendering
thread and the main thread when you draw to a QPainter. After looking at
the source code for QML Canvas it pushes commands to the rendering thread
and then uses those commands to control a QPainter to draw onto a texture
(I think this is how it works).

What I really wish is if QGraphicsScene was decoupled with QWidgets and
allowed for it to run a sperate thread (no the GUI thread). Then you could
have the power of QGraphicsScene with having it block the main thread and
would allow it to render a texture in QML's scene graph.

Phi|ip
-- 
Phi|ip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20161129/a6c73b58/attachment.html>


More information about the Interest mailing list