[Qt-interest] QProgressBar kind of functionality with QProgressDialog (Size of file being copied not known)

Andreas Pakulat apaku at gmx.de
Wed May 27 11:46:50 CEST 2009


On 27.05.09 13:13:33, Usman Ajmal wrote:
> I read the documentation. And as i pointed out in my first mail...i used
> QProgress with minimum and maximum equal to zero, and it worked fine. But i
> don't want a progress bar embedded in my GUI.
> 
> I want a separate window or dialog to appear showing a progress bar with a
> busy indicatior. QProgressDialog provides the dialog but the setMinimum and
> setMaximum equal to zero is not giving the desired result.
> 
> I hope i made myself clear.

Then don't block the gui thread by doing someting like:

while( s = readSomeLine() != "" ) {
        dosomething();
}
 
Your original code has such a while loop just after creating the dialog,
apart from not calling show() on the dialog either. So no wonder you don't
see anything. Either split up the reading into chunks and schedule them via
a timer, or move the reading into a separate thread - and don't forget to
show the dialog.

Andreas

-- 
You are always busy.



More information about the Qt-interest-old mailing list