In the function - loadData(), First, show the dialog with QProgressBar,and then, call setValue() for the progressbar base on the business. when the value of progressbar increase to 100%, hide the dialog and set the value to 0.
My question is: When I enter the loadData() function again, after exec the dlgo->show(), the value of progressbar isn't start from 0, but jump from 100 to 0, and then go on.
What can I do to make the value of progressbar start from 0 when I tried show the dialog again? Thank you!
void loadData() {
mProcessBarDlg->show();
{
mProcessBarDlg->ui.progressBar->setValue(XX);
}
mProcessBarDlg->hide();
mProcessBarDlg->ui.progressBar->setValue(0);
}
XX
when you call loadData() again? If you want it to start from 0,XX
has to be 0. – Quaxton Hale