Active Topics

 


Reply
Thread Tools
Posts: 3,617 | Thanked: 2,412 times | Joined on Nov 2009 @ Cambridge, UK
#21
I just did:
Code:
progress = QtGui.QProgressDialog(self)
progress.setWindowTitle('Loading')
progress.setValue(10)
...
progress.setValue(20)
...
progress.setValue(100)
The dialog appears after the first setValue() and disappears when the value is set to 100 (the default maximum) - that's all just the default behaviour.
 
Posts: 6 | Thanked: 3 times | Joined on Apr 2010
#22
Hi,
You have to call Qapplication:rocessEvents() continiously in a loop to let the main event loop redraw progress after you set it.

progress.setValue(1)
for(int i=0;i<100;i++)
{
//do something, copy a file etc.
progress.setValue(x); //x is some value corresponding to your progress.
Qapplication:rocessEvents(); //your progress bar would move according to x.
}
 

The Following User Says Thank You to vhs For This Useful Post:
Posts: 3,617 | Thanked: 2,412 times | Joined on Nov 2009 @ Cambridge, UK
#23
Originally Posted by vhs View Post
Hi,
You have to call Qapplication:rocessEvents() continiously in a loop to let the main event loop redraw progress after you set it.
Not if it's modal - setValue() will call QApplication:rocessEvents() automatically then.
 
Posts: 58 | Thanked: 10 times | Joined on Dec 2009
#24
It works a lot better with .processEvents()
It actually gets displayed like it should.
Still can't get the "infinite looping" to work
 
Posts: 3,319 | Thanked: 5,610 times | Joined on Aug 2008 @ Finland
#25
AFAIK you need to set both minimum and maximum to 0, but on Qt4.5 for Maemo IIRC that had some styling issues.
__________________
Blogging about mobile linux - The Penguin Moves!
Maintainer of PyQt (see introduction and docs), AppWatch, QuickBrownFox, etc
 
Posts: 58 | Thanked: 10 times | Joined on Dec 2009
#26
I have given up on these Qt bugs.
Got it working with creating my own progress dialog.
Progress bar (when set to 0) works fine.

Last edited by zolakt; 2010-05-10 at 10:23.
 
Reply


 
Forum Jump


All times are GMT. The time now is 07:37.