(QtBeginner) GraphicScene update() and repaint() SLOW performance
-
This post is deleted! -
What number of points do you have?
Some performance hints:
-) Do not use pens with a width other than 1. They are slow (known issue, won't be fixed anymore)
-) Do not draw the line segments one by one, but use drawPolyline insteadYou might also want to take a look at how QWT does it.
-
@Asperamanca said:
number of points do you
ECG wave line has total 2000 points.
I started seeing this slow performance issue after adding a precursor vertical line in front of ECG wave.
Without the precursor line I did not see any slow down issue./Coverup precursor line painter->setPen(QPen(QColor(0,0,0,255))); painter->drawLine(QLineF(left_foregrnd + p0.x(),(int)rect.top(), left_foregrnd + p0.x(), (int)rect.bottom())); //Draw precursor guide line painter->setPen(QPen(QColor(0,190,89,145))); painter->drawLine(QLineF(left_foregrnd + p1.x(),(int)rect.top(), left_foregrnd + p1.x(), (int)rect.bottom())); #endif