PDA

View Full Version : Remove unused points from a QPainterPath



JaV0
4th March 2010, 09:35
Hello. First sorry for my bad english. I'm a Spanish developer and I don't know if I can explain my question in English.

I need to do a Guard, like ksysguard from Linux. The Guard monitors all the incoming or outgoing calls comming into my office, so it's in real-time.
I'm using a QGraphicsScene linked to a QGraphicsView and two QGraphicsPathItem's, one for Incoming Calls(incomingPath) and the other for Outgoing Calls(outgoingPath).

Every second I do this:
incomingPath.path().lineTo(QPoint(x,y1));
outgoingPath.path().lineTo(QPoint(x,y2));

where the "x" value increases by one unit because time is running, and If one call cames the "y*" value also increases by one unit.

If every second I add the new point to the path, when the programm is running about 10 mins I have a Path with a lot of points I don't use!! because I only can show the last part of the path that fits on the screen. So my question, (at last...) is:

How can I remove the first points I added to the QPainterPath? or please help me if I need to change my implementation and do this in other way.

Thanks.