I'm using QT 4.8.5. I met some problems on QProgressDialog with MinimumDuration. Here is the documentation: http://doc.qt.io/qt-4.8/qprogressdialog.html#minimumDuration-prop.
1.Test with the following code. The dialog is not displayed at all. But the documentation says: "the dialog will pop up after the minimumDuration time or as soon as any progress is set".
QProgressDialog* dlg = new QProgressDialog("Test", "cancel", 0, 10);
dlg->setMinimumDuration(8000);
2.Test with the following code. The dialog is displayed in 8 seconds. But the documentation says: "the dialog will pop up after the minimumDuration time or as soon as any progress is set". Though the behavior is different with the documentation, I think the current behavior is acceptable.
QProgressDialog* dlg = new QProgressDialog("Test", "cancel", 0, 10);
dlg->setMinimumDuration(8000);
dlg->setValue(0);
3.Test with the following code. The dialog is never displayed. But the documentation says: "the dialog will pop up after the minimumDuration time or as soon as any progress is set".
QProgressDialog* dlg = new QProgressDialog("Test", "cancel", 0, 10);
dlg->setMinimumDuration(8000);
dlg->setValue(1);
4.Test with the following code. The behavior is same as item 2.
QProgressDialog* dlg = new QProgressDialog("Test", "cancel", 0, 10);
dlg->setMinimumDuration(8000);
dlg->setValue(0);
dlg->setValue(1);
5.Test with the following code. The dialog is displayed as soon as set the progress value to 1. Why does Sleep() function affect the behavior here?
QProgressDialog* dlg = new QProgressDialog("Test", "cancel", 0, 10);
dlg->setMinimumDuration(8000);
dlg->setValue(0);
::Sleep(static_cast<DWORD>(1000));
dlg->setValue(1);
6.Test with the code below. The dialog is displayed immediately, but I set MinimumDuration to 5. Is it a problem?
QProgressDialog* dialog = new QProgressDialog("Message", "Close", 1, 10);
dialog->setMinimumDuration(5000);
dialog->setValue(0);
dialog->setValue(1);
I test on Windoes 7. What are the issues? What are the correct behaviors?