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
progressBar->setMaximum(0);
progressBar->setMinimum(0);
QString program
= "dd if=/dev/mem of=";
program.append(lineEdit_saveAt->text());
myProcess->start(program);
//if myProcess->waitForFinished() {
progressBar->setMaximum(100);
progressBar->setValue(100);
//}
QObject *parent;
progressBar->setMaximum(0);
progressBar->setMinimum(0);
QString program = "dd if=/dev/mem of=";
program.append(lineEdit_saveAt->text());
QProcess *myProcess= new QProcess(parent);
QCoreApplication::processEvents();
myProcess->start(program);
//if myProcess->waitForFinished() {
progressBar->setMaximum(100);
progressBar->setValue(100);
//}
To copy to clipboard, switch view to plain text mode
Please suggest something. Thanks
Bookmarks