Just set the QProgressDialog as the parent of the new dialog which is being showed up.
A small example
int main(int argc, char * argv[])
{
int value = 100;
dialog.setMaximum(value);
dialog.show();
for(int i = 0; i <= value; i++)
{
app.thread()->msleep(1000);
dialog.setValue(i);
app.processEvents();
if((i%10) == 0)
{
QMessageBox::information(&dialog,
"Message",
"Click OK to Continue");
}
}
return 0;
}
int main(int argc, char * argv[])
{
QApplication app(argc, argv);
QProgressDialog dialog;
int value = 100;
dialog.setMaximum(value);
dialog.show();
for(int i = 0; i <= value; i++)
{
app.thread()->msleep(1000);
dialog.setValue(i);
app.processEvents();
if((i%10) == 0)
{
QMessageBox::information(&dialog, "Message", "Click OK to Continue");
}
}
return 0;
}
To copy to clipboard, switch view to plain text mode
Bookmarks