PyQt - clear widget for redraw

Peter nospamjynyl at yahoo.co.nz
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.

TIA

Peter


-------------------------
 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):
          p.drawLine(mar,mar+vsp*i,hrz*(l1[i]+1),mar+vsp*i)
-------------------------




More information about the Python-list mailing list