PyQt - clear widget for redraw
From: Peter (nospamjynyl_at_yahoo.co.nz)
Date: 07/31/04
- Next message: Christian Tismer: "Re: Replacement for locals() ???"
- Previous message: Lawrence Oluyede: "Re: Importance of C# (was Re: IronPython-0.6 is now available!)"
- Next in thread: Diez B. Roggisch: "Re: PyQt - clear widget for redraw"
- Reply: Diez B. Roggisch: "Re: PyQt - clear widget for redraw"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 31 Jul 2004 23:02:24 +1200
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)
-------------------------
- Next message: Christian Tismer: "Re: Replacement for locals() ???"
- Previous message: Lawrence Oluyede: "Re: Importance of C# (was Re: IronPython-0.6 is now available!)"
- Next in thread: Diez B. Roggisch: "Re: PyQt - clear widget for redraw"
- Reply: Diez B. Roggisch: "Re: PyQt - clear widget for redraw"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|