I have a function that does series of actions, e.g. loading, processing and sending data, for several object instances in a loop. I use a QProgressDialog to display the current progress and interrupt it if necessary. However, during the data sending, due to particularities of the receiving side, it is extremely problematic to interrupt, so I would like to hide temporarily the Cancel button and to show it during the other steps.
The best that I did is the following:
for(i=0; i<N; i++) {
//loading
progress.setCancelButton(new QPushButton("Cancel"));
...
//processing
...
//sending
progress.setCancelButton(0);
...
}
The first loading is ok. However, after the button disappears during the first sending, it never appears there where it was. I don't have any idea how to place it anywhere, since I don't have any access to it?
Is there any solution? Thanks!
Bookmarks