[PyKDE] Using QScrollView to manage a changing list of widge

Jonathan Gardner jgardn at alumni.washington.edu
Tue Feb 18 06:52:01 GMT 2003


On Monday 17 February 2003 21:03, Jim Bublitz wrote:
> On 18-Feb-03 Jonathan Gardner wrote:
<snip>
> >
> > Anyways, it works fine as long as I am looking at a different tab
> > as I change the patient. If I am looking at it, it clears, but
> > won't show what has been added.
> >
>
> After just taking a quick look, there's a couple of things I'd try:
> first, you might want to try calling the show () methods for the
> QLabels or QVBox, or otherwise forcing a redraw (show () is usually
> the best way). Second, you might want to look at QWidgetStack, which
> is designed for adding/removing widgets (there's an example in the
> Qt docs). I've had some flakiness (but nothing related to an
> example like yours) with removeChild, but could just be my code too.
>

Jim, thanks for the tip. As far as QWidgetStack, is concerned, it wasn't quite 
what I was looking for.

However, putting in a QWidget.show() (self.vbox.show()) after modifying the 
contents solved the problem. I'll post a simple example of the code that 
works if anyone is interested.

-- 
Jonathan Gardner
jgardn at alumni.washington.edu
Python Qt perl apache and linux




More information about the PyQt mailing list