Reputation: 3061
I'm having some trouble with a QProgressDialog on my app.
When the user clicks on a calculation button, I show a QProgressDialog that is updated from a QThread (I don't think this is related to the problem), and when this QThread finishes I call a function that closes the QProgressDialog.
progressDialog->setValue(100);
progressDialog->close();
It seems to be working.
But if the user clicks on the calculation button and minimizes the app (main window), the QProgressDialog don't close:
I already checked and the code is reaching on the command:
progressDialog->close();
I don't know what is happening, can someone help me?
Thanks
Upvotes: 0
Views: 1415
Reputation: 3061
I solved the problem by adding the following attribute to my progress dialog:
progressDialog->setAttribute(Qt::WA_DeleteOnClose, true);
Upvotes: 3