[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] Some fundamentals
From:       Phil Thompson <phil () river-bank ! demon ! co ! uk>
Date:       2003-02-25 11:10:00
[Download RAW message or body]

On Tuesday 25 February 2003 10:55 am, Tom Chance wrote:
> Well thank you to all who replied - that's much clearer now. By the time
> I'm finished with Python, I sweat I'm going to be half-way towards knowing
> C/C++ as well, as so many docs (even the O'Reilly books) seem to assume
> you're coming from it, and explain everything in terms of it! Anyway, I
> understand that all now, and I've worked out how to use it which is the
> important thing :)
>
> There's one other thing that has puzzled me lately, and I can only assume
> that it's either a misunderstanding or a bug on my part. I've got some code
> which, on the push of a button, scans the DVD device, then populates the
> ListView with items for each track. Currently, the code works like so:
>
> ----
> print "Scanning DVD"
>
> (popen command to get number of tracks)
> for i in range(numtracks):
>     (popen command to get track info)
>     print (info about track)
>     (add ListViewItem)
>
> print "Finished"
> ----
>
> Now I would expect that the ListViewItems would appear one by one as the
> for loop scans each track. But what happens is that it prints out the info
> for each track as it goes along, but only populates the ListView with the
> items when it's done. Why is this?

The screen gets updated when you return to the Qt event loop. Have a look at 
QApplication.processEvents().

Phil

_______________________________________________
PyKDE mailing list    PyKDE@mats.gmd.de
http://mats.gmd.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic