I am drawing with QPainterPath at regular times. ALl in all, I have a slot called every 100 ms that updates the position of the tip adding a new point to the path. How could I keep the last 1000 points and discard and free the memory of the older ones?