PyQt - clear widget for redraw

Peter nospamjynyl at
Sat Jul 31 13:02:24 CEST 2004

I want to draw some lines on a widget.
This works ok, but when I want to redraw, the old lines are still there.

How do I clear or refresh the widget, so I can draw a new set of lines?

Code snip below.



 def paintLines(self, e):
      p = QPainter(e)
      mar = e.width()/100  # margin
      vsp = 2              # vertical spacing
      hrz = (e.width() - 2*mar)/100  # horizontal scalar
      for i in range(100):

More information about the Python-list mailing list