[PyKDE] My thinking still wrong?

Tina Isaksen tina at bestemselv.com
Sun Feb 26 17:57:10 GMT 2006


David Boddie wrote:

>  
>
>>You now have 2 Options: 
>>
>>1) Call QApplication::processEvents (IIRC that was the name of the
>>function) after setting the text. This makes Qt process any pending
>>events (like the redraw of the label) and then returning to your
>>code-part, AFAIK.
>>    
>>
>
>Yes, this works quite well. However, it still doesn't solve the problem
>of long delays if "apt-get" takes a long time to finish. There's a way
>to fix this that _shouldn't_ be too hard (see option 3).
>  
>
Cool that you posted this right now, because I did use the processEvents 
and it did the job for the 'apt-get update' since that's a fairly quick 
process. But I have spent the last couple of hours reasearching other 
ways to do it for apt operations that takes conciderably more time. And 
for that a simple 'Pleae wait' message dosen't cut it since it will look 
like it has crashed. So I have played around with redirecting stdin/ 
stdou without getting much wiser... so far ;)

>
>3) Run "apt-get update" in another process, using either QProcess or
>   a Python standard library module. QProcess will execute a command
>   with arguments, and lets you read the output and errors as they
>   become available. There are ways of monitoring the command's
>   status and collecting the output.
>
>One of the easiest ways to use QProcess in this way is to do something like
>the following. (Note: this is untested.)
>  
>
Interesting. Will toss it around for a bit and see what I can make of 
it... if anything. I'm still on very thin ice every time I try something 
new. But that's paty of the fun, right? :)

Tina




More information about the PyQt mailing list