I want to find the more suitable solution for drawing a timeline than qml canvas
-
Hello everyone, I drew a timeline using QML Canvas, initially there were usually no more than 600 rectangles on it and everything was fine, but when there were 1000+, friezes began when changing the "zoom" and redrawing everything, on average redrawing one canvas took 50-70ms, which of course a lot, I stopped pulling interval array elements from the C++ and moved everything to qml, began to draw the visible part, separated the marker canvas from the timeline canvas so as not to redraw so often, but only with zooms. And the situation improved to 20ms, but of course, with the increase in the number of rectangles to 2000 and the appearance of 4 timelines on 1 canvas, 60ms returned.
And I had a question, wouldn't it be more optimal to rewrite the timeline on QPainter and send the finished canvas drawn by QPainter to qml? Or even follow this example and write a timeline on QOpenGLWidget and somehow drag it into QML.
Please advise what to choose and how to be.
QPainter vs QML Canvas vs QOpenglWidget
Here is an example of my timeline:
PS: HOW the developers of qt creator made the timeline of the QML profiler so smooth, unfortunately I did not find the source code:(