, I showed an example of creating a custom QML object in C ++ using
, which has a
method, and in this paint method, you can draw the necessary objects on the graphics scene using a QPainter class object. Developers who worked extensively with drawing methods from widgets, as well as with customization and delegates in classic widgets, will not see anything fundamentally new when using the
But this approach is deprecated, applied to QML, is generally not recommended and is slow, because the rendering is performed by means of the processor, not the graphics card. I was convinced on my personal experience how slow the drawing of a large image on the widget can be.
But a new approach using the
method, which uses
tools and accordingly refers to the PC graphical system, is recommended, as well as much more productive than the outdated method.
I suggest repeating the example from tutorial 024 to see the difference in the code and get the following result.