i want to render a plot with a lot of points (>1.000.000) and different colors in a custom QQuickItem
.
Later I want to animate these Points (fading between coordinates and colors), so I think QQuickPaintedItem
is not fast enough for this and I must using the updatePaintNode
interface of QQuickItem
.
The problem is to set the color for each point. Must I create for each Point a QSGGeometryNode
and add Geometry and ColorMaterial? Or is there a faster solution?
Best Regards
I worked a little bit with openGL and found a solution that worked for me
The normal OpenGL examples used
QSGGeometry::Point2D
to set up the verticies. But there is a Version with color support,too(QSGGeometry::defaultAttributes_ColoredPoint2D())
. So I can set up the verticies with//EDIT: the next problem is that the gui freezes from time to time , if the QSGeometry-Object has to many verticies. I don't know why. The GUI is slow down after allocate the memory for the verticies, so this approach has not good performance.
//EDIT 2:
I added a simplified code of the current
updatePaint
-method. If the data object is very huge (>2.000.000 points), the widgets renders the points but than the whole gui is hanging and stuttering.I could localize the error. after calling initializing the
QSGGeometry
-object(geometry = new QSGGeometry(QSGGeometry::defaultAttributes_ColoredPoint2D(), data.size());
) the gui is very slow.Greetings