QML and Recursive Shaders
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhO27MOq1VWZ6hTjO8L6wWQ5vFxTCbrU-2jK-cSKC-DFqRZL3p1EW2-02DG3XaMrwDUERs0ov_KPdlr4JFs3hDn7VN_tA7-BXRdKHJH5lfgGqD0OUp4Cd4sE28h936cRxgJSAyowRVDpMI/s1600/gforce_sc1.jpg)
Let's say that you want your Qt5/QML UI to contain sort of a graph. Instead of presenting just the current value, your want user to see few seconds into history how the value has changed. Something like this: To implement the above component with Qt5 & QML, there are at least 3 possibilities: 1) Use QML Canvas and draw the graph using JavaScript. 2) Use QQuickPaintedItem and draw the graph using C++ QPainter APIs. 3) Use QQuickItem and draw using OpenGL and QSG* helpers. First of these is "easiest", no C++ is required but performance and features go along HTML5 canvas API. Second one is good for those familiar with QPainter, but it also has a small performance cost as rendering goes either through QImage or FBO. Third QQuickItem option performs the best and is optimal for Qt5 scene graph, but working with scene graph QSG* classes and OpenGL can feel a bit too low level. As the title of this blog post suggest, there is also a candidate number 4: Use a r