Ok, I investigated it further and I have now the following code.
progress->setWindowModality(Qt::WindowModal);
progress->setLabelText("Calculating..");
progress->setMinimumSize(400, 40);
progress->setRange(0, 100);
progress->setValue(1); // AFAIU this is what shows the progress dialog
rsyncProcess->start(program, args);
rsyncProcess->waitForFinished();
progress->setValue(100); // AFAIU this is where the progress dialog closes
QProgressDialog *progress = new QProgressDialog("Processing...", "Abort", 0, INT_MAX, this);
progress->setWindowModality(Qt::WindowModal);
progress->setLabelText("Calculating..");
progress->setMinimumSize(400, 40);
progress->setRange(0, 100);
progress->setValue(1); // AFAIU this is what shows the progress dialog
QProcess *rsyncProcess = new QProcess;
rsyncProcess->start(program, args);
rsyncProcess->waitForFinished();
progress->setValue(100); // AFAIU this is where the progress dialog closes
To copy to clipboard, switch view to plain text mode
The problem with this is that the dialog seems to be actually shown _after_ the rsyncprocess is finished and so it always appears only for few milliseconds, no matter the time the rsyncProcess actually takes, which is not what I need of course. I have also tried using a busy indicator with range 0, 0 but this does not change the described behavior, the dialog seems to appear after te rsyncprocess is finished.
progress->setWindowModality(Qt::WindowModal);
progress->setLabelText("Calculating..");
progress->setMinimumSize(400, 40);
progress->setRange(0, 0);
progress->setValue(1); // AFAIU this is what shows the progress dialog
rsyncProcess->start(program, args);
rsyncProcess->waitForFinished();
progress->setValue(0); // AFAIU this is where the progress dialog closes
QProgressDialog *progress = new QProgressDialog("Processing...", "Abort", 0, INT_MAX, this);
progress->setWindowModality(Qt::WindowModal);
progress->setLabelText("Calculating..");
progress->setMinimumSize(400, 40);
progress->setRange(0, 0);
progress->setValue(1); // AFAIU this is what shows the progress dialog
QProcess *rsyncProcess = new QProcess;
rsyncProcess->start(program, args);
rsyncProcess->waitForFinished();
progress->setValue(0); // AFAIU this is where the progress dialog closes
To copy to clipboard, switch view to plain text mode
Any suggestion please?
Bookmarks