On Sonntag, 24. März 2019 11:40:07 CET Uwe Rathmann wrote: > On 3/24/19 10:41 AM, Allan Sandfeld Jensen wrote: > > Note though that the recommended way of doing hardware accelerated > > painting > > these days with Qt, is using QML or the QtQuick scenegraph from C++. > > QPainter being so sequential and imperative will never be able to take > > full advantage of OpenGL because the API wasn't designed for it. > > For an application, where you have to draw a curve of many points, that > are changing with every frame I don't see how the scenegraph is > beneficial. And why do you consider imperative vs. declarative being > relevant here at all ? > Because imperative in the case of QPainter means immediate. The result is expected to have been committed to the paint device when the call returns. The creates extra overhead, due to a lot of small OpenGL calls constantly changes states and issuing short non-batched draw calls. So it is not that declarative is better, but that we need a non-immediate model, which declarative easily can be. Note also that if you use the QtQuick scene graph from C++ you are not programming declarative, you are just using the scene graph we developed to be more efficient with hardware acceleration, so it would still be imperative, just less immediate and thus better optimized than the QPainter model.
'Allan _______________________________________________ Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development