[Interest] QSGRenderNode and OpenGL rendering using QPainter

Daljit Singh daljit97 at live.com
Sun Sep 20 11:36:16 CEST 2020


Hi, I wanted to make use of QSGRenderNode to paint some QML items using third party libraries (mainly Skia). So I decided to gave it a go, but I am having a trouble on understanding how to properly use this class. I have wrote a simple class derived on QQuickItem that essentially paints a QSGRenderNode using its updatePaintNode method.
To paint the node, I am currently using QPainter together with QOpenGLPaintDevice, but my code produces unexpected results. Here is an example https://pastebin.com/BzMzhu41, where I am trying to create an item that paints a line from (0,0) to (400,400).
I would expect this code to create a QML Item  (https://pastebin.com/6ZRrMvFi) that paints a line from the top-left towards the bottom right of the item, but instead the line seems drawn with an incorrect offset.
I suspect this has something to do OpenGL (on which I am not an expert on), but not really sure. Could someone point me in the right direction on how to go about this?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200920/8e20ffce/attachment.html>


More information about the Interest mailing list