After don't having much luck with QProgressDialog...i now turned to ProgressDialog but encountered another problem.

I got the to and fro movement of a blue fluid in the progress bar, depicting the busy state, but i want to make the bar filled with blue fluid at the completion of the operation i am performing.

But problem is that for the busy indicator i need to setMaximum=0. And at the end of process i need to set setMaximum to say 100 and setValue to 100 too.

When i run my app, the later setMaximum seems to overide the previous setMaximum and as soon as the app runs, the progressBar gives a 100% reading with the blue fluid filled comletely in it, without showing any busy indicatior.

If i use the waitForFinished() function of QProcess to wait until my task is finished (and then setting the setMaximum=100 and setValue=100) then my app gets frozen and i neither get a busy indicatior nor a blue fluid filled bar.

Following is the code
Qt Code:
  1. QObject *parent;
  2. progressBar->setMaximum(0);
  3. progressBar->setMinimum(0);
  4.  
  5. QString program = "dd if=/dev/mem of=";
  6. program.append(lineEdit_saveAt->text());
  7. QProcess *myProcess= new QProcess(parent);
  8. QCoreApplication::processEvents();
  9.  
  10. myProcess->start(program);
  11.  
  12. //if myProcess->waitForFinished() {
  13. progressBar->setMaximum(100);
  14. progressBar->setValue(100);
  15. //}
To copy to clipboard, switch view to plain text mode 

Please suggest something. Thanks