I am trying to make a simple example with QProgressDialog. So I have one QPushButton in a widget and when I press it, a QProgressDialog appears, progresses until 100 and then hides.
My problem is that if I click the save button for the second time, the QProgressDialog just appears and disappears.
The code of my slot that is called when the user presses the button:
progressDialog->show();
progressDialog->setWindowModality(Qt::WindowModal);
for(int i = 0; i <= 100; ++i)
{
progressDialog->setValue(i);
if(progressDialog->wasCanceled())
break;
}