arjunasd
24th August 2007, 16:01
Hi
I have use QPainter to drawlines. I draw a line based on the mouse pointer's current position. My problem is when the mouse moves the new lines are drawn but the old one's remain. Can anyone just how to remove the old lines.
I use the following command:
painter->drawLine(0, 0, x1, y1);
where x1, y1 is the current position of the mouse.
Also, when I point the mouse back to an old position where there was a line already drawn, the line disappaers. I do not understand why the old lines disappear when it should be redrawn. Could someone explain me the concept?
Thanks
Arjun
I have use QPainter to drawlines. I draw a line based on the mouse pointer's current position. My problem is when the mouse moves the new lines are drawn but the old one's remain. Can anyone just how to remove the old lines.
I use the following command:
painter->drawLine(0, 0, x1, y1);
where x1, y1 is the current position of the mouse.
Also, when I point the mouse back to an old position where there was a line already drawn, the line disappaers. I do not understand why the old lines disappear when it should be redrawn. Could someone explain me the concept?
Thanks
Arjun