Please explain what you mean by "cannot get it working". The progress dialog shouldn't need processEvents(), the call is embeded into QProgressDialog::setValue().
Please explain what you mean by "cannot get it working". The progress dialog shouldn't need processEvents(), the call is embeded into QProgressDialog::setValue().
A possible issue is that you set the progress dialog's range to 0 to myModel->model->rowCount() and then proceed to feed it values from 0 to linesetIndexes.size()-2 in your for loop. Only you know if the two upper bounds are related to each other.
@wysota: The for-loop does some heavy calculations. At that phase, the application looks like it hangs, but it does not. At the end of the calculations the application comes back to life and presents them. It is only then when the progress bar appears with value 100%. If I uncomment:
then the box of the progress bar appears with the window title and nothing else in it. At the end of the calculations the progress bar appears again with value 100%
@ChrisW67: the linesetIndexes.size()-1 is known before the for-loop starts and it is always greater than 5 or six. So there it should be some progress![]()
any ideas?
I'd have to see a minimal compilable example reproducing the problem.
I think you have missed the point. The range of values you have told the dialog to expect and the range of values you subsequently feed it through calls to setValue may not be comparable, and you haven't addressed that point. For example: if myModel->model->rowCount() is 1000 and you feed the values from 0 to 5 or 6 into the progress dialog through setValue() then the bar is hardly going to move significantly even if it is working.
Another problem: the "processing" step, left blank in the example code, might take varying amounts of time to complete per iteration. If execution time per iteration varies widely, you'll get hangs between some updates and not others.
Bookmarks