How to make a QProgressBar full?

Hello.
Use QProgressDialog. Inside, it has QProgressBar, which at some point have to be installed on a maximum of (fill in the blank), show that the process is completed.
PB = new QProgressDialog(this);
PB->setAutoClose(false);
PB->setWindowModality(Qt::WindowModal);
PB->setMinimum(1);
PB->setMaximum(100);
PB->setValue(100); // progress bar becomes empty

The point is that when you set the current value to the maximum, the progress bar becomes empty, instead of filled. I don't know how to fix it. Please tell me how to put a value on the maximum?

PS.: tried different methods:
// #1
PB->setValue(PB->maximum()); // same thing
// #2
PB->setValue(PB->maximum() - 1); // rounded up to 99%
// #3
PB->setMaximum(100);
PB->setValue(99.99999 f); // rounded up to 99%
September 26th 19 at 06:27
2 answers
September 26th 19 at 06:29
Solution
For future applicants: the QProgressDialog is the property autoReset (default true), which resets the value to achieve the maximum. To solve the problem, you must set this value to false:
p_diag = new QProgressDialog(this);
p_diag->setAutoClose(false);
p_diag->setAutoReset(false); // do not reset value
September 26th 19 at 06:31
ui->progressBar->setValue(ui->progressBar->maximum());

This code certainly works. The problem in the surrounding code.
Thank you - emelia59 commented on September 26th 19 at 06:34

Find more questions by tags C++Qt